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

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

Instances details

Foldable StateQueue Source # |

Instance details

Defined in Text.Regex.Applicative.StateQueue

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> StateQueue a -> m Source #

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

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

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

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

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

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

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

null :: StateQueue a -> Bool Source #

length :: StateQueue a -> Int Source #

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

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

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

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

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

Show a => Show (StateQueue a) Source # |
Instance details Defined in Text.Regex.Applicative.StateQueue Methods showsPrec :: Int -> StateQueue a -> ShowS Source # show :: StateQueue a -> String Source # showList :: [StateQueue a] -> ShowS Source #
Eq a => Eq (StateQueue a) Source # |
Instance details Defined in Text.Regex.Applicative.StateQueue Methods (==) :: StateQueue a -> StateQueue a -> Bool Source # (/=) :: StateQueue a -> StateQueue a -> Bool Source #

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