| Stability | experimental |
|---|---|
| Maintainer | conal@conal.net |
FunctorCombo.MemoTrie
Description
Functor-based memo tries (strict for now)
Documentation
Domain types with associated memo tries
Methods
trie :: (k -> v) -> k :->: vSource
Create the trie for the entire domain of a function
untrie :: (k :->: v) -> k -> vSource
Convert k trie to k function, i.e., access k field of the trie
enumerate :: (k :->: v) -> [(k, v)]Source
List the trie elements. Order of keys (:: k) is always the same.
Instances
| HasTrie Bool | |
| HasTrie Int | |
| HasTrie Integer | |
| HasTrie () | |
| HasTrie a => HasTrie [a] | |
| HasTrie a => HasTrie (Id a) | |
| HasTrie a => HasTrie (Tree a) | |
| (HasTrie a, HasTrie (:->: a b)) => HasTrie (a -> b) | |
| (HasTrie a, HasTrie b) => HasTrie (Either a b) | |
| (HasTrie a, HasTrie b) => HasTrie (a, b) | |
| HasTrie x => HasTrie (Const x a) | |
| HasTrie (:->: (PF (Tree a) (Tree a)) v) => HasTrie (TreeTrie a v) | |
| HasTrie (:->: (PF [a] [a]) v) => HasTrie (ListTrie a v) | |
| (HasTrie a, HasTrie b, HasTrie c) => HasTrie (a, b, c) | |
| HasTrie (g (f a)) => HasTrie (:. g f a) | |
| (HasTrie (f a), HasTrie (g a)) => HasTrie (:+: f g a) | |
| (HasTrie (f a), HasTrie (g a)) => HasTrie (:*: f g a) | |
| (HasTrie a, HasTrie b, HasTrie c, HasTrie d) => HasTrie (a, b, c, d) |