Safe Haskell | None |
---|---|
Language | Haskell2010 |
- memoize :: Ord a => (a -> IO b) -> IO (a -> IO b)
- memoizeLru :: Ord a => Maybe Integer -> (a -> IO b) -> IO (a -> IO b)
- memoizeTime :: Ord a => Millisecond -> (a -> IO b) -> IO (a -> IO b)
- constMemoize :: IO b -> IO (IO b)
- constMemoizeTime :: Millisecond -> IO b -> IO (IO b)
Documentation
memoize :: Ord a => (a -> IO b) -> IO (a -> IO b) Source
Caches function return values so that when the same arguments are provided to a function, it's not called
memoizeLru :: Ord a => Maybe Integer -> (a -> IO b) -> IO (a -> IO b) Source
Version of memoize
that uses an LRU cache rather than always keeping results
in memory
memoizeTime :: Ord a => Millisecond -> (a -> IO b) -> IO (a -> IO b) Source
Version of memoize
keeps results for a certain amount of time
constMemoize :: IO b -> IO (IO b) Source
Caches an IO actions result
constMemoizeTime :: Millisecond -> IO b -> IO (IO b) Source
Caches an IO actions result for some amount of time