Internal representation of a trie.
Author: Lasse Züngel
Version: October 2024
empty'
:: InternalTrie a
An empty internal trie. |
null'
:: InternalTrie a -> Bool
Returns true iff the internal trie is empty. |
singleton'
:: String -> a -> InternalTrie a
A singleton internal trie. |
insert'
:: String -> a -> InternalTrie a -> (Bool,InternalTrie a)
|
delete'
:: String -> InternalTrie a -> Maybe (InternalTrie a)
|
lookup'
:: String -> InternalTrie a -> Maybe a
Looks up a value in the internal trie. |
toList'
:: InternalTrie a -> [(String,a)]
Converts an internal trie into a list of key-value pairs. |
second
:: (a -> b) -> (c,a) -> (c,b)
Auxiliary functions |
Internal representation of a trie.
Constructors:
InternalTrie
:: (Maybe a) -> [(Char,InternalTrie a)] -> InternalTrie a
An empty internal trie.
|
Returns true iff the internal trie is empty. |
A singleton internal trie. |
|
|
Looks up a value in the internal trie. |
Converts an internal trie into a list of key-value pairs. |
Auxiliary functions |