Skip to content

Commit

Permalink
addded non-default initTails implementation for Seq
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed Feb 27, 2024
1 parent ec15fb5 commit b5ad836
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mono-traversable/src/Data/Sequences.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,11 @@ instance IsSequence (Seq.Seq a) where
{-# INLINE indexEx #-}
{-# INLINE unsafeIndex #-}

initTails = its . (,) mempty
where
its x@(is, y Seq.:<| ts) = x : its (is Seq.:|> y, ts)
its (_, Seq.Empty) = mempty

instance SemiSequence (V.Vector a) where
type Index (V.Vector a) = Int
reverse = V.reverse
Expand Down

0 comments on commit b5ad836

Please sign in to comment.