Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A Seq
that must contain at least one item.
Synopsis
- 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 Source #
Conceptually this is a Seq
that always contains at least one item.
Instances
fore :: Functor f => (a -> f a) -> NonEmptySeq a -> f (NonEmptySeq a) Source #
van Laarhoven lens for the first element
aft :: Functor f => (Seq a -> f (Seq a)) -> NonEmptySeq a -> f (NonEmptySeq a) Source #
van Laarhoven lens for the remaining elements
nonEmptySeqToSeq :: NonEmptySeq a -> Seq a Source #
Flattens a NonEmptySeq
to a Seq
.
seqToNonEmptySeq :: Seq a -> Maybe (NonEmptySeq a) Source #
If the Seq
has at least one item, create a NonEmptySeq
.
prependSeq :: Seq a -> NonEmptySeq a -> NonEmptySeq a Source #
Prepends a Seq
to a NonEmptySeq
.
appendSeq :: NonEmptySeq a -> Seq a -> NonEmptySeq a Source #
Appends a Seq
to a NonEmptySeq
.
singleton :: a -> NonEmptySeq a Source #
Place a single item at the head of the NonEmptySeq
.