regex-applicative-0.3.2.1: 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

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

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