| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Trie
Synopsis
- data Trie k v = Trie {}
- rootT :: Ord k => v -> Trie k v
- lookupT :: Ord k => [k] -> Trie k v -> Maybe v
- memberT :: Ord k => [k] -> Trie k v -> Bool
- modifyT :: Ord k => (v -> v) -> [k] -> Trie k v -> Trie k v
- modifyNodeT :: Ord k => (Trie k v -> Trie k v) -> [k] -> Trie k v -> Trie k v
- allocPathT :: Ord k => [k] -> v -> v -> Trie k v -> Trie k v
- allocModifyT :: Ord k => (v -> v) -> [k] -> v -> Trie k v -> Trie k v
- allocModifyPathT :: Ord k => (v -> v) -> [k] -> v -> Trie k v -> Trie k v
- modifyPathT :: Ord k => (v -> v) -> [k] -> Trie k v -> Trie k v
- pathT :: Ord k => [k] -> Trie k v -> [v]
Documentation
modifyT :: Ord k => (v -> v) -> [k] -> Trie k v -> Trie k v #
\(O(k \log w)\) Does nothing if no such vertex exist.
modifyNodeT :: Ord k => (Trie k v -> Trie k v) -> [k] -> Trie k v -> Trie k v #
\(O(k \log w)\) Does nothing if no such vertex exist.
allocPathT :: Ord k => [k] -> v -> v -> Trie k v -> Trie k v #
\(O(k \log w)\) Non-existing nodes in the path will have the same payload.
allocModifyT :: Ord k => (v -> v) -> [k] -> v -> Trie k v -> Trie k v #
\(O(k \log w)\) Allocates a path from the root to a node and modifies the payload of the target node.
allocModifyPathT :: Ord k => (v -> v) -> [k] -> v -> Trie k v -> Trie k v #
\(O(k \log w)\) Allocates a path from the root to a node and modifies the payload of the node in the path.
modifyPathT :: Ord k => (v -> v) -> [k] -> Trie k v -> Trie k v #
\(O(k \log w)\) Modifies payload of a node and their parents.
Constraints
- The key must be in the map.