cryptol-2.2.6: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2015 Galois, Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.REPL.Trie

Description

Synopsis

- data Trie a = Node (Map Char (Trie a)) (Maybe a)
- emptyTrie :: Trie a
- insertTrie :: String -> a -> Trie a -> Trie a
- lookupTrie :: String -> Trie a -> [a]
- lookupTrieExact :: String -> Trie a -> [a]
- leaves :: Trie a -> [a]

# Documentation

data Trie a Source

Maps string names to values, allowing for partial key matches and querying.

Constructors

Node (Map Char (Trie a)) (Maybe a) |

Instances

Show a => Show (Trie a) Source |

emptyTrie :: Trie a Source

insertTrie :: String -> a -> Trie a -> Trie a Source

Insert a value into the Trie. Will call `panic` if a value already exists with that key.

lookupTrie :: String -> Trie a -> [a] Source

Return all matches with the given prefix.

lookupTrieExact :: String -> Trie a -> [a] Source

Given a key, return either an exact match for that key, or all matches with the given prefix.

leaves :: Trie a -> [a] Source

Return all of the values from a Trie.