Stability | experimental |
---|---|
Maintainer | conal@conal.net |
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
- trieBits :: Bits t => (t -> a) -> [Bool] :->: a
- untrieBits :: Bits t => ([Bool] :->: a) -> t -> a
Documentation
memo2 :: (HasTrie s, HasTrie t) => (s -> t -> a) -> s -> t -> aSource
Memoize a binary function, on its first argument and then on its second. Take care to exploit any partial evaluation.
memo3 :: (HasTrie r, HasTrie s, HasTrie t) => (r -> s -> t -> a) -> r -> s -> t -> aSource
Memoize a ternary function on successive arguments. Take care to exploit any partial evaluation.