monad-memo-0.5.4: monad-memo.cabal
Name: monad-memo
Version: 0.5.4
-- A short (one-line) description of the package.
Synopsis: Memoization monad transformer
-- A longer description of the package.
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 appropriate /*eval*/ or /*run*/ function to evaluate resulting `MonadMemo` monad:
.
>startEvalMemo (fibm 100)
.
See detailed description and examples: "Control.Monad.Memo"
-- URL for the project homepage or repository.
Homepage: https://github.com/EduardSergeev/monad-memo
-- The license under which the package is released.
License: BSD3
-- The file containing the license text.
License-file: LICENSE
-- The package author(s).
Author: Eduard Sergeev
-- An email address to which users can send suggestions, bug reports,
-- and patches.
Maintainer: eduard.sergeev@gmail.com
Category: Control, Monad
Build-type: Simple
-- Constraint on the version of Cabal needed to build this package.
Cabal-version: >=1.10
Tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.2.2
GHC==8.4.3
GHC==8.6.5
GHC==8.8.4
GHC==9.2.1
Extra-source-files:
CHANGELOG.md,
README.md,
example/*.hs,
example/Customisation/*.hs
Source-repository head
type: git
location: https://github.com/EduardSergeev/monad-memo.git
Library
default-language: Haskell2010
build-depends:
base >= 3.0 && <= 5.0,
transformers >= 0.2,
containers >= 0.3,
array >= 0.3,
vector >= 0.7,
primitive >= 0.3
if impl(ghc < 7.10)
build-depends:
transformers-compat >= 0.3
exposed-modules:
Control.Monad.Memo,
Control.Monad.Memo.Class,
Control.Monad.Trans.Memo.ReaderCache,
Control.Monad.Trans.Memo.StateCache,
Control.Monad.Trans.Memo.State,
Control.Monad.Trans.Memo.Map,
Control.Monad.Memo.Array,
Control.Monad.Memo.Array.Instances,
Control.Monad.Memo.Vector,
Control.Monad.Memo.Vector.Expandable,
Control.Monad.Memo.Vector.Unsafe,
Control.Monad.Memo.Vector.Instances,
Data.MapLike,
Data.MapLike.Instances,
Data.MaybeLike,
Data.MaybeLike.Instances
Test-suite tests
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
build-depends:
monad-memo,
base >= 3.0 && <= 5.0,
transformers >= 0.2,
containers >= 0.3,
array >= 0.3,
vector >= 0.7,
primitive >= 0.3,
random >= 1.0,
QuickCheck >= 2.0,
test-framework-quickcheck2 >= 0.2.9,
test-framework >= 0.3.3
if impl(ghc < 7.10)
build-depends:
transformers-compat >= 0.3
other-modules:
MemoTest
Benchmark all
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
main-is: Main.hs
build-depends:
monad-memo,
base >= 3.0 && <= 5.0,
transformers >= 0.2,
containers >= 0.3,
array >= 0.3,
vector >= 0.7,
primitive >= 0.3,
criterion >= 0.6
if impl(ghc < 7.10)
build-depends:
transformers-compat >= 0.3