cryptol-3.0.0: Cryptol: The Language of Cryptography

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

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

Instances details

Show a => Show (Trie a) Source # |
Instance details Defined in Cryptol.REPL.Trie Methods showsPrec :: Int -> Trie a -> ShowS Source # show :: Trie a -> String Source # showList :: [Trie a] -> ShowS Source #

emptyTrie :: Trie a Source #

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

Insert a value into the Trie, forcing the key value to lower case. 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.