regex-pderiv-0.1.0: Replaces/Enhances Text.Regex

Text.Regex.PDeriv.Dictionary

Description

A module that implements a dictionary/hash table

Synopsis

Documentation

class Key a whereSource

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 aSource

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

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

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

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

the dictionary (k,a) version of elem

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

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 aSource

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