zenacy-html-2.0.2: A standard compliant HTML parsing library

Safe HaskellSafe
LanguageHaskell2010

Zenacy.HTML.Internal.Trie

Description

A basic trie over byte strings.

Synopsis

Documentation

data Trie a Source #

Defines the tree.

Instances
Show a => Show (Trie a) Source # 
Instance details

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 #

Inserts a value into a trie.

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.