The latest version of monad-memo is 0.5.4-0.

monad-memo

Version 0.5.0 revision 0 uploaded by EduardSergeev.

Package meta

Synopsis
Memoization monad transformer
Description

Memoization monad transformer supporting most of the standard monad transformers and a range of memoization cache types: from default pure maps to extremely fast mutable vectors

To add memoization behaviour to a monadic function:

1) Add Control.Monad.Memo.memo combinator at the point when memoization is required (i.e. recursive call)

import Control.Monad.Memo

fibm 0 = return 0
fibm 1 = return 1
fibm n = do
  n1 <- memo fibm (n-1)
  n2 <- memo fibm (n-2)
  return (n1+n2)

2) Use approprite *eval* or *run* function to evaluate resulting MonadMemo monad:

startEvalMemo (fibm 100)

See detailed description and examples: Control.Monad.Memo

Author
Eduard Sergeev
Bug reports
n/a
Category
Control, Monad
Copyright
n/a
Homepage
https://github.com/EduardSergeev/monad-memo
Maintainer
eduard.sergeev@gmail.com
Package URL
n/a
Stability
n/a

Components