-
Notifications
You must be signed in to change notification settings - Fork 5
/
monad-memo.cabal
143 lines (125 loc) · 3.62 KB
/
monad-memo.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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: [email protected]
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