Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.Regex.Applicative.StateQueue
Description
This internal module is exposed only for testing and benchmarking. You don't need to import it.
Synopsis
- data StateQueue a
- empty :: StateQueue a
- insert :: a -> StateQueue a -> StateQueue a
- insertUnique :: Int -> a -> StateQueue a -> StateQueue a
- getElements :: StateQueue a -> [a]
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 # | |
Defined in Text.Regex.Applicative.StateQueue Methods fold :: Monoid m => StateQueue m -> m foldMap :: Monoid m => (a -> m) -> StateQueue a -> 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 | |
Show a => Show (StateQueue a) Source # | |
Defined in Text.Regex.Applicative.StateQueue Methods showsPrec :: Int -> StateQueue a -> ShowS show :: StateQueue a -> String showList :: [StateQueue a] -> ShowS | |
Eq a => Eq (StateQueue a) Source # | |
Defined in Text.Regex.Applicative.StateQueue |
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
.
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