regex-deriv-0.0.5: Replaces/Enhances Text.Regex. Implementing regular expression matching using Brzozowski's Deriviatives

Safe HaskellSafe-Inferred
LanguageHaskell98

Text.Regex.Deriv.Dictionary

Description

A module that implements a dictionary/hash table

Synopsis

Documentation

class Key a where Source

Methods

hash :: a -> [Int] Source

Instances

Key Char 
Key Int 
Key RE 
Key Pat 
Key a => Key [a] 
(Key a, Key b) => Key (a, b) 
(Key a, Key b, Key c) => Key (a, b, c) 

newtype Dictionary a Source

Constructors

Dictionary (Trie a) 

insert :: Key k => k -> a -> Dictionary a -> Dictionary a Source

lookup :: Key k => k -> Dictionary a -> Maybe a Source

lookupAll :: Key k => k -> Dictionary a -> [a] Source

member :: Key k => k -> Dictionary a -> Bool Source

fromList :: Key k => [(k, a)] -> Dictionary a Source

update :: Key k => k -> a -> Dictionary a -> Dictionary a Source

the dictionary (k,a) version of elem

isIn :: (Key k, Eq k) => k -> Dictionary (k, a) -> Bool Source

nub :: (Key k, Eq k) => [k] -> [k] Source

nubSub :: (Key k, Eq k) => [k] -> Dictionary (k, ()) -> [k] Source

data Trie a Source

Constructors

Trie ![a] !(IntMap (Trie a)) 

insertTrie :: Bool -> [Int] -> a -> Trie a -> Trie a Source

lookupTrie :: [Int] -> Trie a -> Maybe (Trie a) Source

updateTrie :: [Int] -> a -> Trie a -> Trie a Source