Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- cachedIO :: NominalDiffTime -> IO a -> IO (IO a)
Documentation
cachedIO :: NominalDiffTime -> IO a -> IO (IO a) Source
Cache an IO action, producing a version of this IO action that is cached
for interval
seconds. Immediately initialize the cache with the given IO
action.
The outer IO is responsible for setting up the cache. Use the inner one to
either get the cached value or refresh, if the cache is older than interval
seconds.