non-empty-0.1.1: 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

Empty [] 
Empty Maybe 
Empty T 
Empty (T f) 

class Cons f whereSource

Methods

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

Instances

Cons [] 
Cons f => Cons (T f) 
(Cons f, Empty 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 Functor f => Zip f whereSource

It must hold:

 fmap f xs
    = zipWith (\x _ -> f x) xs xs
    = zipWith (\_ x -> f x) xs xs

Methods

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

Instances

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

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

class Repeat f whereSource

Methods

repeat :: a -> f aSource

Instances

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

class Sort f whereSource

Methods

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

Instances

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

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

class Reverse f whereSource

Methods

reverse :: f a -> f aSource

Instances

class Show f whereSource

Methods

showsPrec :: Show a => Int -> f a -> ShowSSource

Instances

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

class Arbitrary f whereSource

Methods

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

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

Instances