non-empty-sequence-0.2.0.4: Non-empty sequence

Safe HaskellSafe
LanguageHaskell2010

Data.Sequence.NonEmpty

Description

A Seq that must contain at least one item.

Synopsis

Documentation

data NonEmptySeq a Source #

Conceptually this is a Seq that always contains at least one item.

Constructors

NonEmptySeq 

Fields

Instances
Monad NonEmptySeq Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Functor NonEmptySeq Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Methods

fmap :: (a -> b) -> NonEmptySeq a -> NonEmptySeq b #

(<$) :: a -> NonEmptySeq b -> NonEmptySeq a #

Applicative NonEmptySeq Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Methods

pure :: a -> NonEmptySeq a #

(<*>) :: NonEmptySeq (a -> b) -> NonEmptySeq a -> NonEmptySeq b #

liftA2 :: (a -> b -> c) -> NonEmptySeq a -> NonEmptySeq b -> NonEmptySeq c #

(*>) :: NonEmptySeq a -> NonEmptySeq b -> NonEmptySeq b #

(<*) :: NonEmptySeq a -> NonEmptySeq b -> NonEmptySeq a #

Foldable NonEmptySeq Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Methods

fold :: Monoid m => NonEmptySeq m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmptySeq a -> m #

foldr :: (a -> b -> b) -> b -> NonEmptySeq a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmptySeq a -> b #

foldl :: (b -> a -> b) -> b -> NonEmptySeq a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmptySeq a -> b #

foldr1 :: (a -> a -> a) -> NonEmptySeq a -> a #

foldl1 :: (a -> a -> a) -> NonEmptySeq a -> a #

toList :: NonEmptySeq a -> [a] #

null :: NonEmptySeq a -> Bool #

length :: NonEmptySeq a -> Int #

elem :: Eq a => a -> NonEmptySeq a -> Bool #

maximum :: Ord a => NonEmptySeq a -> a #

minimum :: Ord a => NonEmptySeq a -> a #

sum :: Num a => NonEmptySeq a -> a #

product :: Num a => NonEmptySeq a -> a #

Traversable NonEmptySeq Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Methods

traverse :: Applicative f => (a -> f b) -> NonEmptySeq a -> f (NonEmptySeq b) #

sequenceA :: Applicative f => NonEmptySeq (f a) -> f (NonEmptySeq a) #

mapM :: Monad m => (a -> m b) -> NonEmptySeq a -> m (NonEmptySeq b) #

sequence :: Monad m => NonEmptySeq (m a) -> m (NonEmptySeq a) #

Eq a => Eq (NonEmptySeq a) Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Data a => Data (NonEmptySeq a) Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmptySeq a -> c (NonEmptySeq a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmptySeq a) #

toConstr :: NonEmptySeq a -> Constr #

dataTypeOf :: NonEmptySeq a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmptySeq a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmptySeq a)) #

gmapT :: (forall b. Data b => b -> b) -> NonEmptySeq a -> NonEmptySeq a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptySeq a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptySeq a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NonEmptySeq a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmptySeq a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmptySeq a -> m (NonEmptySeq a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptySeq a -> m (NonEmptySeq a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptySeq a -> m (NonEmptySeq a) #

Ord a => Ord (NonEmptySeq a) Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Show a => Show (NonEmptySeq a) Source # 
Instance details

Defined in Data.Sequence.NonEmpty

Semigroup (NonEmptySeq a) Source # 
Instance details

Defined in Data.Sequence.NonEmpty

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

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.