Safe Haskell | Safe |
---|---|
Language | Haskell98 |
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, then place the fixed-length list variant in NonEmpty and the other one here.
Synopsis
- groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [T [] a]
- groupPairs :: (Foldable f, Eq a) => f (a, b) -> [(a, T [] b)]
- groupKey :: (Foldable f, Eq a) => (b -> a) -> f b -> [(a, T [] b)]
- groupEithers :: Foldable f => f (Either a b) -> [Either (T [] a) (T [] b)]
- segmentAfter :: Foldable f => (a -> Bool) -> f a -> ([T [] a], [a])
- segmentBefore :: Foldable f => (a -> Bool) -> f a -> ([a], [T [] a])
- filterToInfixes :: Foldable f => (a -> Bool) -> f a -> [T [] a]
- mapAdjacent :: (Cons f, Zip f) => (a -> a -> b) -> T f a -> f b
- take :: (View g, Repeat f, Traversable f) => g a -> Maybe (f a)
- splitAt :: (View g, Repeat f, Traversable f) => g a -> (Maybe (f a), g a)
- sliceVertical :: (View g, Repeat f, Traversable f) => g a -> ([f a], g a)
- 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
- iterate :: (Repeat f, Traversable f) => (a -> a) -> a -> f a
- class Choose f where
- choose :: [a] -> [f a]
Documentation
sliceVertical :: (View g, Repeat f, Traversable f) => g a -> ([f a], g a) Source #
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 a Source #
iterate :: (Repeat f, Traversable f) => (a -> a) -> a -> f a Source #