non-empty-0.1.3: List-like structures with static restrictions 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 Seq 
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

class Append f whereSource

Methods

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

Instances

Append [] 
Append Seq 
(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 Seq 
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

Create a container with as many copies as possible of a given value. That is, for a container with fixed size n, the call repeat x will generate a container with n copies of x.

Instances

Repeat [] 
Repeat T 
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 Seq 
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