Safe Haskell | Safe-Inferred |
---|
Implementation of a Ternary Search Tree: https://en.wikipedia.org/wiki/Ternary_search_tree, which is a structure useful to store any list-like thing. It is quite resistant to non-random data without needing rebalancing and can be as fast or faster than hash tables.
The usual finite map operations are provided, plus utilities to match wildcarded words efficiently.
- data TST sym v
- empty :: Ord sym => TST sym v
- singleton :: Ord sym => [sym] -> v -> TST sym v
- insert :: Ord sym => [sym] -> v -> TST sym v -> TST sym v
- insertWith :: Ord sym => (v -> v -> v) -> [sym] -> v -> TST sym v -> TST sym v
- lookup :: Ord sym => [sym] -> TST sym v -> Maybe v
- delete :: Ord sym => [sym] -> TST sym v -> TST sym v
- toList :: Ord sym => TST sym v -> [([sym], v)]
- fromList :: Ord sym => [([sym], v)] -> TST sym v
- data WildCard a
- type WildList a = [WildCard a]
- matchWL :: Ord sym => WildList sym -> TST sym v -> [([sym], v)]