compact-sequences-0.2.0.0: Stacks, queues, and deques with compact representations.

Safe HaskellNone
LanguageHaskell2010

Data.CompactSequence.Deque.Internal

Documentation

data Deque n a Source #

Constructors

Empty 
Shallow !(Array n a) 
Deep11 !(Array n a) !(Deque (Twice n) a) !(Array n a) 
Deep12 !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) 
Deep13 !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) 
Deep14 !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) !(Array n a) 
Deep21 !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) 
Deep22 !(Array n a) !(Array n a) (Deque (Twice n) a) !(Array n a) !(Array n a) 
Deep23 !(Array n a) !(Array n a) (Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) 
Deep24 !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) !(Array n a) 
Deep31 !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) 
Deep32 !(Array n a) !(Array n a) !(Array n a) (Deque (Twice n) a) !(Array n a) !(Array n a) 
Deep33 !(Array n a) !(Array n a) !(Array n a) (Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) 
Deep34 !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) !(Array n a) 
Deep41 !(Array n a) !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) 
Deep42 !(Array n a) !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) 
Deep43 !(Array n a) !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) 
Deep44 !(Array n a) !(Array n a) !(Array n a) !(Array n a) !(Deque (Twice n) a) !(Array n a) !(Array n a) !(Array n a) !(Array n a) 
Instances
Functor (Deque n) Source # 
Instance details

Defined in Data.CompactSequence.Deque.Internal

Methods

fmap :: (a -> b) -> Deque n a -> Deque n b #

(<$) :: a -> Deque n b -> Deque n a #

Foldable (Deque n) Source # 
Instance details

Defined in Data.CompactSequence.Deque.Internal

Methods

fold :: Monoid m => Deque n m -> m #

foldMap :: Monoid m => (a -> m) -> Deque n a -> m #

foldr :: (a -> b -> b) -> b -> Deque n a -> b #

foldr' :: (a -> b -> b) -> b -> Deque n a -> b #

foldl :: (b -> a -> b) -> b -> Deque n a -> b #

foldl' :: (b -> a -> b) -> b -> Deque n a -> b #

foldr1 :: (a -> a -> a) -> Deque n a -> a #

foldl1 :: (a -> a -> a) -> Deque n a -> a #

toList :: Deque n a -> [a] #

null :: Deque n a -> Bool #

length :: Deque n a -> Int #

elem :: Eq a => a -> Deque n a -> Bool #

maximum :: Ord a => Deque n a -> a #

minimum :: Ord a => Deque n a -> a #

sum :: Num a => Deque n a -> a #

product :: Num a => Deque n a -> a #

Traversable (Deque n) Source # 
Instance details

Defined in Data.CompactSequence.Deque.Internal

Methods

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

sequenceA :: Applicative f => Deque n (f a) -> f (Deque n a) #

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

sequence :: Monad m => Deque n (m a) -> m (Deque n a) #

Eq a => Eq (Deque n a) Source # 
Instance details

Defined in Data.CompactSequence.Deque.Internal

Methods

(==) :: Deque n a -> Deque n a -> Bool #

(/=) :: Deque n a -> Deque n a -> Bool #

Ord a => Ord (Deque n a) Source # 
Instance details

Defined in Data.CompactSequence.Deque.Internal

Methods

compare :: Deque n a -> Deque n a -> Ordering #

(<) :: Deque n a -> Deque n a -> Bool #

(<=) :: Deque n a -> Deque n a -> Bool #

(>) :: Deque n a -> Deque n a -> Bool #

(>=) :: Deque n a -> Deque n a -> Bool #

max :: Deque n a -> Deque n a -> Deque n a #

min :: Deque n a -> Deque n a -> Deque n a #

consA :: Size n -> Array n a -> Deque n a -> Deque n a Source #

snocA :: Size n -> Deque n a -> Array n a -> Deque n a Source #

data ViewL n a Source #

Constructors

EmptyL 
ConsL !(Array n a) (Deque n a) 

data ViewR n a Source #

Constructors

EmptyR 
SnocR (Deque n a) !(Array n a) 

viewLA :: Size n -> Deque n a -> ViewL n a Source #

viewRA :: Size n -> Deque n a -> ViewR n a Source #

data ShiftedL n a Source #

Constructors

ShiftedL !(Array n a) !(Array n a) (Deque (Twice n) a) 

data ShiftedR n a Source #

Constructors

ShiftedR (Deque (Twice n) a) !(Array n a) !(Array n a) 

shiftLA :: Size n -> Deque (Twice n) a -> Array n a -> Array n a -> ShiftedL n a Source #

shriftL :: Size n -> Array (Twice n) a -> Deque (Twice n) a -> ShiftedL n a Source #

shiftRA :: Size n -> Array n a -> Array n a -> Deque (Twice n) a -> ShiftedR n a Source #

shriftR :: Size n -> Array (Twice n) a -> Deque (Twice n) a -> ShiftedR n a Source #

consSnocA :: Size n -> Array n a -> Deque n a -> Array n a -> Deque n a Source #

data UCUS n a Source #

Constructors

EmptyUCUS 
OneUCUS !(Array n a) 
UCUS !(Array n a) (Deque n a) !(Array n a) 

unconsUnsnocA :: Size n -> Deque n a -> UCUS n a Source #

data Deque_ n a Source #

Constructors

Empty_ 
Shallow_ !(Array n a) 
Deep_ !(Digit n a) (Deque (Twice n) a) !(Digit n a) 

matchDeep :: Deque n a -> Deque_ n a Source #

pattern Deep :: Digit n a -> Deque (Twice n) a -> Digit n a -> Deque n a Source #

data Digit n a Source #

Constructors

One !(Array n a) 
Two !(Array n a) !(Array n a) 
Three !(Array n a) !(Array n a) !(Array n a) 
Four !(Array n a) !(Array n a) !(Array n a) !(Array n a) 

fromListNM :: Size sz -> Int -> State [a] (Deque sz a) Source #

fromListNS :: Size sz -> Bin45 -> State [a] (Deque sz a) Source #