non-empty-0.2: List-like structures with static restrictions on the number of elements

Safe HaskellNone

Data.NonEmpty.Mixed

Description

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.

Synopsis

Documentation

groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [T [] a]Source

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.

init :: (ViewR f, Empty f, Cons f) => T f a -> f aSource

last :: ViewR f => T f a -> aSource

tails :: (ViewL f, Empty f) => f a -> T [] (f a)Source

inits :: (ViewL f, Cons f, Empty f) => f a -> T [] (f a)Source

appendLeft :: Cons f => [a] -> f a -> f aSource