non-empty-0.0: List-like structures with static checks on the number of elements

Safe HaskellNone

Data.NonEmpty.Class

Synopsis

Documentation

class Empty f whereSource

Methods

empty :: f aSource

Instances

class Cons f whereSource

Methods

cons :: a -> f a -> f aSource

Instances

Cons [] 
Cons f => Cons (T f) 

class View f whereSource

Methods

viewL :: f a -> Maybe (a, f a)Source

Instances

class Singleton f whereSource

Methods

singleton :: a -> f aSource

Instances

class Append f whereSource

Methods

append :: f a -> f a -> f aSource

Instances

Append [] 
(Cons f, Append f) => Append (T f) 

class Zip f whereSource

Methods

zipWith :: (a -> b -> c) -> f a -> f b -> f cSource

Instances

Zip [] 
Zip Maybe 
Zip f => Zip (T f) 

zip :: Zip f => f a -> f b -> f (a, b)Source

class Sort f whereSource

Methods

sortBy :: (a -> a -> Ordering) -> f a -> f aSource

insertBy :: (a -> a -> Ordering) -> a -> f a -> (a, f a)Source

Instances

Sort [] 
Sort Maybe 
Sort f => Sort (T f) 

sort :: (Ord a, Sort f) => f a -> f aSource

insert :: (Ord a, Sort f) => a -> f a -> (a, f a)Source

Insert an element into an ordered list while preserving the order. The first element of the resulting list is returned individually. We need this for construction of a non-empty list.

class Arbitrary f whereSource

Methods

arbitrary :: Arbitrary a => Gen (f a)Source

shrink :: Arbitrary a => f a -> [f a]Source

Instances