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

Safe Haskell | Safe
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

`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 |
Eq a => Eq (StateQueue a) |
Show a => Show (StateQueue a) |

empty :: StateQueue a

The empty state queue

insert :: a -> StateQueue a -> StateQueue a

Insert an element in the state queue without a key.

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

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]

Get the list of all elements