Portability | non-portable (multi-param classes, functional dependencies) |
---|---|
Stability | experimental |
Maintainer | eduard.sergeev@gmail.com |
Safe Haskell | Safe-Inferred |
Specialization of MemoStateT
with Map
as a container
- type MemoT k v = MemoStateT (Map k v) k v
- runMemoT :: Monad m => MemoT k v m a -> Map k v -> m (a, Map k v)
- evalMemoT :: Monad m => MemoT k v m a -> Map k v -> m a
- startRunMemoT :: Monad m => MemoT k v m a -> m (a, Map k v)
- startEvalMemoT :: Monad m => MemoT k v m a -> m a
- type Memo k v = MemoT k v Identity
- runMemo :: Memo k v a -> Map k v -> (a, Map k v)
- evalMemo :: Memo k v a -> Map k v -> a
- startRunMemo :: Memo k v a -> (a, Map k v)
- startEvalMemo :: Memo k v a -> a
MemoT monad transformer
type MemoT k v = MemoStateT (Map k v) k vSource
Memoization monad transformer which uses Map
as a cache container
runMemoT :: Monad m => MemoT k v m a -> Map k v -> m (a, Map k v)Source
Given an initial cache, compute the result of a memoized computation along with the final state of the cache
evalMemoT :: Monad m => MemoT k v m a -> Map k v -> m aSource
Given an initial state, compute the result of a memoized computation discarding the final state of the cache
startRunMemoT :: Monad m => MemoT k v m a -> m (a, Map k v)Source
Compute the result of memoized computation along with the final state of the cache.
This function uses empty Map
as an initial state
startEvalMemoT :: Monad m => MemoT k v m a -> m aSource
Compute the result of a memoized computation discarding the final state of the cache.
This function uses empty Map
as an initial state
Memo monad
runMemo :: Memo k v a -> Map k v -> (a, Map k v)Source
Given an initial cache, compute the result of a memoized computation along with the final state of the cache
evalMemo :: Memo k v a -> Map k v -> aSource
Given an initial state, compute the result of a memoized computation discarding the final state of the cache
startRunMemo :: Memo k v a -> (a, Map k v)Source
Compute the result of memoized computation along with the final state of the cache.
This function uses empty Map
as an initial state
startEvalMemo :: Memo k v a -> aSource
Compute the result of a memoized computation discarding the final state of the cache.
This function uses empty Map
as an initial state