Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Data.Sequence.NonEmpty
Description
A Seq
that must contain at least one item.
- data NonEmptySeq a = NonEmptySeq {}
- fore :: Functor f => (a -> f a) -> NonEmptySeq a -> f (NonEmptySeq a)
- aft :: Functor f => (Seq a -> f (Seq a)) -> NonEmptySeq a -> f (NonEmptySeq a)
- nonEmptySeqToSeq :: NonEmptySeq a -> Seq a
- seqToNonEmptySeq :: Seq a -> Maybe (NonEmptySeq a)
- prependSeq :: Seq a -> NonEmptySeq a -> NonEmptySeq a
- appendSeq :: NonEmptySeq a -> Seq a -> NonEmptySeq a
- singleton :: a -> NonEmptySeq a
Documentation
data NonEmptySeq a #
Conceptually this is a Seq
that always contains at least one item.
Constructors
NonEmptySeq | |
Instances
Monad NonEmptySeq # | |
Functor NonEmptySeq # | |
Applicative NonEmptySeq # | |
Foldable NonEmptySeq # | |
Traversable NonEmptySeq # | |
Eq a => Eq (NonEmptySeq a) # | |
Data a => Data (NonEmptySeq a) # | |
Ord a => Ord (NonEmptySeq a) # | |
Show a => Show (NonEmptySeq a) # | |
Semigroup (NonEmptySeq a) # | |
fore :: Functor f => (a -> f a) -> NonEmptySeq a -> f (NonEmptySeq a) #
van Laarhoven lens for the first element
aft :: Functor f => (Seq a -> f (Seq a)) -> NonEmptySeq a -> f (NonEmptySeq a) #
van Laarhoven lens for the remaining elements
nonEmptySeqToSeq :: NonEmptySeq a -> Seq a #
Flattens a NonEmptySeq
to a Seq
.
seqToNonEmptySeq :: Seq a -> Maybe (NonEmptySeq a) #
If the Seq
has at least one item, create a NonEmptySeq
.
prependSeq :: Seq a -> NonEmptySeq a -> NonEmptySeq a #
Prepends a Seq
to a NonEmptySeq
.
appendSeq :: NonEmptySeq a -> Seq a -> NonEmptySeq a #
Appends a Seq
to a NonEmptySeq
.
singleton :: a -> NonEmptySeq a #
Place a single item at the head of the NonEmptySeq
.