Safe Haskell | None |
---|
Data.NonEmpty
- data T f a = Cons {}
- (!:) :: a -> f a -> T f a
- force :: T f a -> T f a
- apply :: (Applicative f, Cons f, Append f) => T f (a -> b) -> T f a -> T f b
- bind :: (Monad f, Cons f, Append f) => T f a -> (a -> T f b) -> T f b
- data Empty a = Empty
- toList :: Foldable f => T f a -> [a]
- flatten :: Cons f => T f a -> f a
- fetch :: View f => f a -> Maybe (T f a)
- cons :: Cons f => a -> T f a -> T f a
- singleton :: Empty f => a -> T f a
- reverse :: (Foldable f, Cons f, Empty f) => T f a -> T f a
- mapHead :: (a -> a) -> T f a -> T f a
- mapTail :: (f a -> g a) -> T f a -> T g a
- init :: (Zip f, Cons f) => T f a -> f a
- last :: Foldable f => T f a -> a
- foldl1 :: Foldable f => (a -> a -> a) -> T f a -> a
- maximum :: (Ord a, Foldable f) => T f a -> a
- minimum :: (Ord a, Foldable f) => T f a -> a
- sum :: (Num a, Foldable f) => T f a -> a
- product :: (Num a, Foldable f) => T f a -> a
- append :: (Cons f, Append f) => T f a -> T f a -> T f a
- cycle :: (Cons f, Append f) => T f a -> T f a
- zipWith :: Zip f => (a -> b -> c) -> T f a -> T f b -> T f c
- sortBy :: Sort f => (a -> a -> Ordering) -> T f a -> T f a
- sort :: (Ord a, Sort f) => T f a -> T f a
- insertBy :: (Sort f, Cons f) => (a -> a -> Ordering) -> a -> T f a -> T f a
- insert :: (Ord a, Sort f, Cons f) => a -> T f a -> T f a
Documentation
The type T
can be used for many kinds of list-like structures
with restrictions on the size.
-
T [] a
is a lazy list containing at least one element. -
T (T []) a
is a lazy list containing at least two elements. -
T Vector a
is a vector with at least one element. You may also use unboxed vectors but the first element will be stored in a box and you will not be able to use many functions from this module. -
T Maybe a
is a list that contains one or two elements. -
T Empty a
is a list that contains exactly one element. -
T (T Empty) a
is a list that contains exactly two elements.
Instances
(Monad f, Empty f, Cons f, Append f) => Monad (T f) | |
Functor f => Functor (T f) | |
(Functor (T f), Applicative f, Empty f, Cons f, Append f) => Applicative (T f) | |
Foldable f => Foldable (T f) | |
(Functor (T f), Foldable (T f), Traversable f) => Traversable (T f) | |
Sort f => Sort (T f) | |
Zip f => Zip (T f) | |
(Cons f, Append f) => Append (T f) | |
Empty f => Singleton (T f) | |
Cons f => Cons (T f) | |
(Eq a, Eq (f a)) => Eq (T f a) | |
(Eq (T f a), Ord a, Ord (f a)) => Ord (T f a) | |
(Show a, Show (f a)) => Show (T f a) | |
(Arbitrary a, Arbitrary f) => Arbitrary (T f a) |
Constructors
Empty |