lazy-cache (hackage): The library provides an interface for caching the results of IO actions. This library relies on a blackholing — mechanism that is used to implement lazy evaluation for avoiding concurrent runs of the action (this is where the name of the library comes from).  The library provides caching mechanismsl with the following properties:  when the function is called the successful result is cached by no more than a provided time;  if the function ends with an exception, it will be rethrown, and the result will not be cached;  if the function will be called with the same input value it immediately gets cached result;  if functions are called concurrently with the different input values they will not block each other;  if functions will be called concurrently with the same argument then only one will act, others will wait until the first one is finished and will either return the result once it's received, or will rethrow an exception if the first one exits with an exception;  outdated values are cleared only on accesses to the cache, so if no action is called the data will not be cleared.  The main entry point of the library is System.Cache module, it explains how to use the library and provides the public API, that does not depend on the actual store implementation.  The library provides an interface for caching, and three implementations:  System.Cache.Impl.Ghc — the main one based on GHC system;  System.Cache.Impl.MVar — implementation based on library functions;  System.Cache.Impl.NoCache — implementation that disables caching, but keeps the same interface  If you want to implement your own caching mechanism, or use internal API, you can refer to the System.Cache.Internal.Interface module for an additional documentation.
Keywords: library|mpl|system