| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.NonEmpty
Contents
- data NonEmptyL f a = a :< (f a)
- headL :: NonEmptyL f a -> a
- tailL :: NonEmptyL f a -> f a
- flattenL :: Alternative f => NonEmptyL f a -> f a
- joinL :: (Alternative f, Monad f) => NonEmptyL f (NonEmptyL f a) -> NonEmptyL f a
- budgeL :: (Alternative f, Alternative g) => NonEmptyL f (g a) -> NonEmptyL f (g a)
- data NonEmptyR f a = (f a) :> a
- lastR :: NonEmptyR f a -> a
- initR :: NonEmptyR f a -> f a
- flattenR :: Alternative f => NonEmptyR f a -> f a
- joinR :: (Alternative f, Monad f) => NonEmptyR f (NonEmptyR f a) -> NonEmptyR f a
- budgeR :: (Alternative f, Alternative g) => NonEmptyR f (g a) -> NonEmptyR f (g a)
The type of left non-empty alternatives
NonEmptyL is naturally extended from List to any Alternative
type in two different ways. They are differentiated by their
instances.
The Left one is well suited for cons structures.
Constructors
| a :< (f a) infixr 5 |
Instances
| (Alternative f, Monad f) => Monad (NonEmptyL f) Source | |
| Functor f => Functor (NonEmptyL f) Source | |
| Alternative f => Applicative (NonEmptyL f) Source | |
| Foldable f => Foldable (NonEmptyL f) Source | |
| (Functor f, Traversable f) => Traversable (NonEmptyL f) Source | |
| Generic1 (NonEmptyL f) Source | |
| Alternative f => Comonad (NonEmptyL f) Source | |
| (Eq a, Eq (f a)) => Eq (NonEmptyL f a) Source | |
| (Data a, Data (f a), Typeable (* -> *) f) => Data (NonEmptyL f a) Source | |
| (Ord a, Ord (f a)) => Ord (NonEmptyL f a) Source | |
| (Read a, Read (f a)) => Read (NonEmptyL f a) Source | |
| (Show a, Show (f a)) => Show (NonEmptyL f a) Source | |
| Generic (NonEmptyL f a) Source | |
| Alternative f => Semigroup (NonEmptyL f a) Source | |
| type Rep1 (NonEmptyL f) Source | |
| type Rep (NonEmptyL f a) Source |
Basic functions for NonEmptyL
flattenL :: Alternative f => NonEmptyL f a -> f a Source
budgeL :: (Alternative f, Alternative g) => NonEmptyL f (g a) -> NonEmptyL f (g a) Source
The type of right non-empty alternatives
The Right one is well suited for snoc structures.
Constructors
| (f a) :> a infixl 5 |
Instances
| Functor f => Functor (NonEmptyR f) Source | |
| Alternative f => Applicative (NonEmptyR f) Source | |
| Foldable f => Foldable (NonEmptyR f) Source | |
| (Functor f, Traversable f) => Traversable (NonEmptyR f) Source | |
| Generic1 (NonEmptyR f) Source | |
| Alternative f => Comonad (NonEmptyR f) Source | |
| (Eq a, Eq (f a)) => Eq (NonEmptyR f a) Source | |
| (Data a, Data (f a), Typeable (* -> *) f) => Data (NonEmptyR f a) Source | |
| (Ord a, Ord (f a)) => Ord (NonEmptyR f a) Source | |
| (Read a, Read (f a)) => Read (NonEmptyR f a) Source | |
| (Show a, Show (f a)) => Show (NonEmptyR f a) Source | |
| Generic (NonEmptyR f a) Source | |
| Alternative f => Semigroup (NonEmptyR f a) Source | |
| type Rep1 (NonEmptyR f) Source | |
| type Rep (NonEmptyR f a) Source |
Basic functions for NonEmptyR
flattenR :: Alternative f => NonEmptyR f a -> f a Source
budgeR :: (Alternative f, Alternative g) => NonEmptyR f (g a) -> NonEmptyR f (g a) Source