regex-pderiv-0.2.0: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives.

Safe HaskellSafe
LanguageHaskell98

Text.Regex.PDeriv.Dictionary

Description

A module that implements a dictionary/hash table

Synopsis

Documentation

class Key a where Source #

Minimal complete definition

hash

Methods

hash :: a -> [Int] Source #

Instances

Key Char Source # 

Methods

hash :: Char -> [Int] Source #

Key Int Source # 

Methods

hash :: Int -> [Int] Source #

Key RE Source # 

Methods

hash :: RE -> [Int] Source #

Key Pat Source # 

Methods

hash :: Pat -> [Int] Source #

Key a => Key [a] Source # 

Methods

hash :: [a] -> [Int] Source #

(Key a, Key b) => Key (a, b) Source # 

Methods

hash :: (a, b) -> [Int] Source #

(Key a, Key b, Key c) => Key (a, b, c) Source # 

Methods

hash :: (a, b, c) -> [Int] Source #

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 #

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 #