regex-pderiv-0.1.2: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives. The svn source also shipped with two other referential implementations, e.g. Thomspon NFA and Glushkov NFA. For more detail please check out http://code.google.com/p/xhaskell-library/

Safe HaskellSafe-Infered

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