Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data CachedData a
- fetch :: CachedData a -> IO a
- fetchCached :: CachedData a -> IO (Maybe a)
- createReadOnceCache :: IO a -> IO (CachedData a)
- createTimedCache :: Int -> Bool -> IO a -> IO (CachedData a)
Documentation
data CachedData a Source #
fetch :: CachedData a -> IO a Source #
Fetch data from a cache
fetchCached :: CachedData a -> IO (Maybe a) Source #
Only fetch data if it has been cached.
:: IO a |
|
-> IO (CachedData a) |
Create a cache which will execute an (IO ()) function on demand a maximum of 1 times.
:: Int |
|
-> Bool |
|
-> IO a |
|
-> IO (CachedData a) |
Create a cache with a timeout from an (IO ()) function.