ouroboros-network-framework-0.1.0.1
Safe Haskell None
Language Haskell2010

Data.Cache

Synopsis

Documentation

newtype Cache a Source #

Cache newtype wrapper allows to perform an action only if the cache is not up-to-date, i.e. different than another value dimmed more recent.

Constructors

Cache

Fields

withCacheA :: ( Applicative m, Eq a) => Cache a -> a -> (a -> m ()) -> m () Source #

Run a computation that depends on a certain cached value, only if the the most recent one is different.

traceWithCache :: ( Applicative m, Eq a) => Tracer m a -> Cache a -> a -> m () Source #

Trace with cache only performs the tracing when the cached value is different than the most recent one.

mapTraceWithCache :: ( Applicative m, Eq a) => (a -> b) -> Tracer m b -> Cache a -> a -> m () Source #

Trace with cache only performs the tracing when the cached value is different than the most recent one. And applies a function to the cache value before tracing.