nonempty-alternative-0.3.0: NonEmpty for Alternative types

Safe HaskellSafe
LanguageHaskell2010

Data.NonEmpty

Contents

Synopsis

The type of left non-empty alternatives

data NonEmptyL f a Source

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

Basic functions for NonEmptyL

headL :: NonEmptyL f a -> a Source

tailL :: 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

data NonEmptyR f a Source

The Right one is well suited for snoc structures.

Constructors

(f a) :> a infixl 5 

Instances

Basic functions for NonEmptyR

lastR :: NonEmptyR f a -> a Source

initR :: NonEmptyR f a -> f a Source

budgeR :: (Alternative f, Alternative g) => NonEmptyR f (g a) -> NonEmptyR f (g a) Source