dlist-nonempty-0.1.1: Non-empty difference lists

Safe HaskellNone
LanguageHaskell2010

Data.DList.NonEmpty.Unsafe

Description

This module exports the internal representation of NonEmptyDList.

Use with care. It's very easy to break the safe interface:

>>> let nedl = NEDL ((1 :|) . map (+1))
>>> nedl <> nedl
fromNonEmpty (1 :| [2])

Synopsis

Documentation

newtype NonEmptyDList a Source #

A difference list is a function that, given a list, returns the original contents of the difference list prepended to the given list.

Implemented as a newtype over [a] -> NonEmpty a.

Constructors

NEDL 

Fields

Instances

Monad NonEmptyDList Source # 
Functor NonEmptyDList Source # 

Methods

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

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

Applicative NonEmptyDList Source # 
Foldable NonEmptyDList Source # 

Methods

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

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

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

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

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

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

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

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

toList :: NonEmptyDList a -> [a] #

null :: NonEmptyDList a -> Bool #

length :: NonEmptyDList a -> Int #

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

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

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

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

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

Traversable NonEmptyDList Source # 

Methods

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

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

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

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

Traversable1 NonEmptyDList Source # 

Methods

traverse1 :: Apply f => (a -> f b) -> NonEmptyDList a -> f (NonEmptyDList b) #

sequence1 :: Apply f => NonEmptyDList (f b) -> f (NonEmptyDList b) #

Alt NonEmptyDList Source # 
Apply NonEmptyDList Source # 
Bind NonEmptyDList Source # 
Foldable1 NonEmptyDList Source # 

Methods

fold1 :: Semigroup m => NonEmptyDList m -> m #

foldMap1 :: Semigroup m => (a -> m) -> NonEmptyDList a -> m #

toNonEmpty :: NonEmptyDList a -> NonEmpty a #

IsList (NonEmptyDList a) Source # 

Associated Types

type Item (NonEmptyDList a) :: * #

Eq a => Eq (NonEmptyDList a) Source # 
Ord a => Ord (NonEmptyDList a) Source # 
Read a => Read (NonEmptyDList a) Source # 
Show a => Show (NonEmptyDList a) Source # 
(~) * a Char => IsString (NonEmptyDList a) Source # 
Semigroup (NonEmptyDList a) Source # 
NFData a => NFData (NonEmptyDList a) Source # 

Methods

rnf :: NonEmptyDList a -> () #

type Item (NonEmptyDList a) Source # 
type Item (NonEmptyDList a) = a