| Maintainer | ylilarry@gmail.com |
|---|---|
| Stability | Experimental |
| Portability | GHC |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Cache.State
Description
This module has everything you need to cache a function (a -> b)
let cache = newCache Nothing :: Cache Int Int
let f = do
withCache doSomethingSlow 3 -- Slow; the result is cached in a map using 3 as the key.
withCache doSomethingSlow 3 -- Read from the cache.
withCache doSomethingSlow 3 :: SCache Int Int
evalState f cache
Documentation
class (IsCache m k, Monad n) => IsSCacheT m k n where Source
Minimal complete definition
Nothing