io-memoize-1.1.1.0: Memoize IO actions

Safe HaskellSafe-Inferred

Control.Concurrent.Cache

Synopsis

Documentation

data Cache a Source

A thread-safe write-once cache. If you need more functionality, (e.g. multiple write, cache clearing) use an MVar instead.

Instances

newCache :: IO (Cache a)Source

Create an empty cache.

fetch :: Cache a -> IO a -> IO aSource

Fetch the value stored in the cache, or call the supplied fallback and store the result, if the cache is empty.