zenacy-html-2.0.2: A standard compliant HTML parsing library
Zenacy.HTML.Internal.Trie
Description
A basic trie over byte strings.
data Trie a Source #
Defines the tree.
Defined in Zenacy.HTML.Internal.Trie
Methods
showsPrec :: Int -> Trie a -> ShowS #
show :: Trie a -> String #
showList :: [Trie a] -> ShowS #
empty :: Trie a Source #
Creates an empty trie.
fromList :: [(BS, a)] -> Trie a Source #
Creates a trie from a list of tuples containing key and value.
insert :: BS -> a -> Trie a -> Trie a Source #
Inserts a value into a trie.
insertWords :: [Word8] -> a -> Trie a -> Trie a Source #
match :: Trie a -> BS -> Maybe (BS, a, BS) Source #
Finds the longest prefix with a value in the trie and returns the prefix, the value, and the remaining string.