Module
Data.NonEmpty
- Package
- purescript-nonempty
- Repository
- purescript/purescript-nonempty
This module defines a generic non-empty data structure, which adds an additional element to any container type.
#NonEmpty Source
data NonEmpty f aA non-empty container of elements of type a.
For example:
nonEmptyList :: NonEmpty List Int
nonEmptyList = 0 :| empty
Constructors
NonEmpty a (f a)
Instances
(Show a, Show (f a)) => Show (NonEmpty f a)(Eq1 f, Eq a) => Eq (NonEmpty f a)(Eq1 f) => Eq1 (NonEmpty f)(Ord1 f, Ord a) => Ord (NonEmpty f a)(Ord1 f) => Ord1 (NonEmpty f)(Functor f) => Functor (NonEmpty f)(FunctorWithIndex i f) => FunctorWithIndex (Maybe i) (NonEmpty f)(Foldable f) => Foldable (NonEmpty f)(FoldableWithIndex i f) => FoldableWithIndex (Maybe i) (NonEmpty f)(Traversable f) => Traversable (NonEmpty f)(TraversableWithIndex i f) => TraversableWithIndex (Maybe i) (NonEmpty f)(Foldable f) => Foldable1 (NonEmpty f)(Unfoldable f) => Unfoldable1 (NonEmpty f)
#(:|) Source
Operator alias for Data.NonEmpty.NonEmpty (right-associative / precedence 5)
An infix synonym for NonEmpty.
#fromNonEmpty Source
fromNonEmpty :: forall r a f. (a -> f a -> r) -> NonEmpty f a -> r#oneOf Source
oneOf :: forall a f. Alternative f => NonEmpty f a -> f a- Modules
- Data.
NonEmpty