foundation-0.0.8: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerNicolas Di Prima <nicolas@primetype.co.uk>
Stabilitystatble
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Foundation.List.DList

Description

Data structure for optimised operations (append, cons, snoc) on list

Documentation

data DList a Source #

Instances

Monad DList Source # 

Methods

(>>=) :: DList a -> (a -> DList b) -> DList b #

(>>) :: DList a -> DList b -> DList b #

return :: a -> DList a #

fail :: String -> DList a #

Functor DList Source # 

Methods

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

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

Applicative DList Source # 

Methods

pure :: a -> DList a #

(<*>) :: DList (a -> b) -> DList a -> DList b #

(*>) :: DList a -> DList b -> DList b #

(<*) :: DList a -> DList b -> DList a #

IsList (DList a) Source # 

Associated Types

type Item (DList a) :: * #

Methods

fromList :: [Item (DList a)] -> DList a #

fromListN :: Int -> [Item (DList a)] -> DList a #

toList :: DList a -> [Item (DList a)] #

Eq a => Eq (DList a) Source # 

Methods

(==) :: DList a -> DList a -> Bool #

(/=) :: DList a -> DList a -> Bool #

Ord a => Ord (DList a) Source # 

Methods

compare :: DList a -> DList a -> Ordering #

(<) :: DList a -> DList a -> Bool #

(<=) :: DList a -> DList a -> Bool #

(>) :: DList a -> DList a -> Bool #

(>=) :: DList a -> DList a -> Bool #

max :: DList a -> DList a -> DList a #

min :: DList a -> DList a -> DList a #

Show a => Show (DList a) Source # 

Methods

showsPrec :: Int -> DList a -> ShowS #

show :: DList a -> String #

showList :: [DList a] -> ShowS #

Monoid (DList a) Source # 

Methods

mempty :: DList a #

mappend :: DList a -> DList a -> DList a #

mconcat :: [DList a] -> DList a #

Collection (DList a) Source # 

Methods

null :: DList a -> Bool Source #

length :: DList a -> Int Source #

elem :: (Eq a, (* ~ a) (Element (DList a))) => Element (DList a) -> DList a -> Bool Source #

notElem :: (Eq a, (* ~ a) (Element (DList a))) => Element (DList a) -> DList a -> Bool Source #

maximum :: (Ord a, (* ~ a) (Element (DList a))) => NonEmpty (DList a) -> Element (DList a) Source #

minimum :: (Ord a, (* ~ a) (Element (DList a))) => NonEmpty (DList a) -> Element (DList a) Source #

any :: (Element (DList a) -> Bool) -> DList a -> Bool Source #

all :: (Element (DList a) -> Bool) -> DList a -> Bool Source #

Foldable (DList a) Source # 

Methods

foldl :: (a -> Element (DList a) -> a) -> a -> DList a -> a Source #

foldl' :: (a -> Element (DList a) -> a) -> a -> DList a -> a Source #

foldr :: (Element (DList a) -> a -> a) -> a -> DList a -> a Source #

foldr' :: (Element (DList a) -> a -> a) -> a -> DList a -> a Source #

Sequential (DList a) Source # 

Methods

take :: Int -> DList a -> DList a Source #

revTake :: Int -> DList a -> DList a Source #

drop :: Int -> DList a -> DList a Source #

revDrop :: Int -> DList a -> DList a Source #

splitAt :: Int -> DList a -> (DList a, DList a) Source #

revSplitAt :: Int -> DList a -> (DList a, DList a) Source #

splitOn :: (Element (DList a) -> Bool) -> DList a -> [DList a] Source #

break :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source #

breakElem :: Element (DList a) -> DList a -> (DList a, DList a) Source #

intersperse :: Element (DList a) -> DList a -> DList a Source #

intercalate :: Element (DList a) -> DList a -> Element (DList a) Source #

span :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source #

filter :: (Element (DList a) -> Bool) -> DList a -> DList a Source #

partition :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) Source #

reverse :: DList a -> DList a Source #

uncons :: DList a -> Maybe (Element (DList a), DList a) Source #

unsnoc :: DList a -> Maybe (DList a, Element (DList a)) Source #

snoc :: DList a -> Element (DList a) -> DList a Source #

cons :: Element (DList a) -> DList a -> DList a Source #

find :: (Element (DList a) -> Bool) -> DList a -> Maybe (Element (DList a)) Source #

sortBy :: (Element (DList a) -> Element (DList a) -> Ordering) -> DList a -> DList a Source #

singleton :: Element (DList a) -> DList a Source #

head :: NonEmpty (DList a) -> Element (DList a) Source #

last :: NonEmpty (DList a) -> Element (DList a) Source #

tail :: NonEmpty (DList a) -> DList a Source #

init :: NonEmpty (DList a) -> DList a Source #

replicate :: Word -> Element (DList a) -> DList a Source #

isPrefixOf :: DList a -> DList a -> Bool Source #

isSuffixOf :: DList a -> DList a -> Bool Source #

type Item (DList a) Source # 
type Item (DList a) = a
type Element (DList a) Source # 
type Element (DList a) = a