regex-applicative-0.3.3: Regex-based parsing with applicative interface

Safe HaskellSafe
LanguageHaskell2010

Text.Regex.Applicative.StateQueue

Description

This internal module is exposed only for testing and benchmarking. You don't need to import it.

Synopsis

Documentation

data StateQueue a Source #

StateQueue is a data structure that can efficiently insert elements (preserving their order) and check whether an element with the given Int key is already in the queue.

Instances
Foldable StateQueue Source # 
Instance details

Defined in Text.Regex.Applicative.StateQueue

Methods

fold :: Monoid m => StateQueue m -> m

foldMap :: Monoid m => (a -> m) -> StateQueue a -> m

foldr :: (a -> b -> b) -> b -> StateQueue a -> b

foldr' :: (a -> b -> b) -> b -> StateQueue a -> b

foldl :: (b -> a -> b) -> b -> StateQueue a -> b

foldl' :: (b -> a -> b) -> b -> StateQueue a -> b

foldr1 :: (a -> a -> a) -> StateQueue a -> a

foldl1 :: (a -> a -> a) -> StateQueue a -> a

toList :: StateQueue a -> [a]

null :: StateQueue a -> Bool

length :: StateQueue a -> Int

elem :: Eq a => a -> StateQueue a -> Bool

maximum :: Ord a => StateQueue a -> a

minimum :: Ord a => StateQueue a -> a

sum :: Num a => StateQueue a -> a

product :: Num a => StateQueue a -> a

Eq a => Eq (StateQueue a) Source # 
Instance details

Defined in Text.Regex.Applicative.StateQueue

Methods

(==) :: StateQueue a -> StateQueue a -> Bool

(/=) :: StateQueue a -> StateQueue a -> Bool

Show a => Show (StateQueue a) Source # 
Instance details

Defined in Text.Regex.Applicative.StateQueue

Methods

showsPrec :: Int -> StateQueue a -> ShowS

show :: StateQueue a -> String

showList :: [StateQueue a] -> ShowS

empty :: StateQueue a Source #

The empty state queue

insert :: a -> StateQueue a -> StateQueue a Source #

Insert an element in the state queue without a key.

Since insert doesn't take a key, it won't affect any insertUnique.

insertUnique Source #

Arguments

:: Int

key

-> a 
-> StateQueue a 
-> StateQueue a 

Insert an element in the state queue, unless there is already an element with the same key

getElements :: StateQueue a -> [a] Source #

Get the list of all elements