Safe Haskell | None |
---|
Functions that cope both with plain and non-empty structures.
If there are two versions of a function, where one works on fixed-length lists, the place the fixed-length list variant to NonEmpty and the other one here.
- groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [T [] a]
- segmentBefore :: Foldable f => (a -> Bool) -> f a -> ([a], [T [] a])
- mapAdjacent :: (Cons f, Zip f) => (a -> a -> b) -> T f a -> f b
- viewR :: (ViewR f, Empty f, Cons f) => T f a -> (f a, a)
- init :: (ViewR f, Empty f, Cons f) => T f a -> f a
- last :: ViewR f => T f a -> a
- tails :: (ViewL f, Empty f) => f a -> T [] (f a)
- inits :: (ViewL f, Cons f, Empty f) => f a -> T [] (f a)
- appendLeft :: Cons f => [a] -> f a -> f a
Documentation
segmentBefore :: Foldable f => (a -> Bool) -> f a -> ([a], [T [] a])Source
mapAdjacent :: (Cons f, Zip f) => (a -> a -> b) -> T f a -> f bSource
viewR :: (ViewR f, Empty f, Cons f) => T f a -> (f a, a)Source
This implementation is more efficient for Sequence than viewR
.
appendLeft :: Cons f => [a] -> f a -> f aSource