Trie-based memoizer Adapted from sjanssen's paste: "a lazy trie" http://hpaste.org/3839.
- class HasTrie a where
- memo :: HasTrie t => (t -> a) -> t -> a
- memo2 :: (HasTrie s, HasTrie t) => (s -> t -> a) -> s -> t -> a
- memo3 :: (HasTrie r, HasTrie s, HasTrie t) => (r -> s -> t -> a) -> r -> s -> t -> a
- mup :: HasTrie t => (b -> c) -> (t -> b) -> t -> c
Mapping from all elements of
a to the results of some function
Convert a trie to a function, i.e., access a field of the trie
Memoize a binary function, on its first argument and then on its second. Take care to exploit any partial evaluation.
Memoize a ternary function on successive arguments. Take care to exploit any partial evaluation.