memoization-utils-0.1.0.1: Utilities for memoizing functions

Safe HaskellNone
LanguageHaskell2010

Control.Memoization.Utils

Synopsis

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