caching-0: Cache combinators.

Safe HaskellNone
LanguageHaskell2010

Data.Cache.Trace

Documentation

data CacheEvent k t v Source #

Constructors

CacheEvict 

Fields

CacheAdd 

Fields

Instances
(Eq k, Eq t, Eq v) => Eq (CacheEvent k t v) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

(==) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

(/=) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

(Ord k, Ord t, Ord v) => Ord (CacheEvent k t v) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

compare :: CacheEvent k t v -> CacheEvent k t v -> Ordering #

(<) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

(<=) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

(>) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

(>=) :: CacheEvent k t v -> CacheEvent k t v -> Bool #

max :: CacheEvent k t v -> CacheEvent k t v -> CacheEvent k t v #

min :: CacheEvent k t v -> CacheEvent k t v -> CacheEvent k t v #

(Read k, Read t, Read v) => Read (CacheEvent k t v) Source # 
Instance details

Defined in Data.Cache.Trace

(Show k, Show t, Show v) => Show (CacheEvent k t v) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

showsPrec :: Int -> CacheEvent k t v -> ShowS #

show :: CacheEvent k t v -> String #

showList :: [CacheEvent k t v] -> ShowS #

type CacheTrace k t v = DList (CacheEvent k t v) Source #

class MonadTrace (trc :: Bool) where Source #

Methods

trace :: Applicative m => w -> Tracable trc w m () Source #

Instances
MonadTrace False Source # 
Instance details

Defined in Data.Cache.Trace

Methods

trace :: Applicative m => w -> Tracable False w m () Source #

MonadTrace True Source # 
Instance details

Defined in Data.Cache.Trace

Methods

trace :: Applicative m => w -> Tracable True w m () Source #

class MonadAtomicRef m => MonadAtomicRefTraced trc w m where Source #

Methods

atomicModifyRefTraced :: Ref m a -> (a -> (a, w, b)) -> Tracable trc w m b Source #

Atomically mutate the contents of a reference with trace data output

atomicModifyRefTraced' :: Ref m a -> (a -> (a, w, b)) -> Tracable trc w m b Source #

Strict version of atomicModifyRefTraced. This forces both the value stored in the reference as well as the value returned but not the trace.

atomicModifyRefTracedM' :: Ref m a -> (forall m'. Monad m' => a -> Tracable trc w m' (a, b)) -> Tracable trc w m b Source #

Strict Monadic update function so that tracing is closer to zero cost when unused.

Instances
(MonadAtomicRef m, Monoid w) => MonadAtomicRefTraced False w m Source # 
Instance details

Defined in Data.Cache.Trace

Methods

atomicModifyRefTraced :: Ref m a -> (a -> (a, w, b)) -> Tracable False w m b Source #

atomicModifyRefTraced' :: Ref m a -> (a -> (a, w, b)) -> Tracable False w m b Source #

atomicModifyRefTracedM' :: Ref m a -> (forall (m' :: Type -> Type). Monad m' => a -> Tracable False w m' (a, b)) -> Tracable False w m b Source #

(MonadAtomicRef m, Monoid w) => MonadAtomicRefTraced True w m Source # 
Instance details

Defined in Data.Cache.Trace

Methods

atomicModifyRefTraced :: Ref m a -> (a -> (a, w, b)) -> Tracable True w m b Source #

atomicModifyRefTraced' :: Ref m a -> (a -> (a, w, b)) -> Tracable True w m b Source #

atomicModifyRefTracedM' :: Ref m a -> (forall (m' :: Type -> Type). Monad m' => a -> Tracable True w m' (a, b)) -> Tracable True w m b Source #

atomicModifyRefTracedM'_ :: (MonadAtomicRefTraced trc w m, forall mg. Monad mg => Functor (Tracable trc w mg)) => Ref m a -> (forall m'. (Monad m', Functor (Tracable trc w m')) => a -> Tracable trc w m' a) -> Tracable trc w m () Source #

data family Tracable (trc :: Bool) :: * -> (* -> *) -> * -> * Source #

Instances
Monoid w => MonadTrans (Tracable False w) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

lift :: Monad m => m a -> Tracable False w m a #

Monoid w => MonadTrans (Tracable True w) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

lift :: Monad m => m a -> Tracable True w m a #

Monad m => Monad (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

(>>=) :: Tracable False w m a -> (a -> Tracable False w m b) -> Tracable False w m b #

(>>) :: Tracable False w m a -> Tracable False w m b -> Tracable False w m b #

return :: a -> Tracable False w m a #

fail :: String -> Tracable False w m a #

(Monoid w, Monad m) => Monad (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

(>>=) :: Tracable True w m a -> (a -> Tracable True w m b) -> Tracable True w m b #

(>>) :: Tracable True w m a -> Tracable True w m b -> Tracable True w m b #

return :: a -> Tracable True w m a #

fail :: String -> Tracable True w m a #

Functor m => Functor (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

fmap :: (a -> b) -> Tracable False w m a -> Tracable False w m b #

(<$) :: a -> Tracable False w m b -> Tracable False w m a #

Functor m => Functor (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

fmap :: (a -> b) -> Tracable True w m a -> Tracable True w m b #

(<$) :: a -> Tracable True w m b -> Tracable True w m a #

MonadFix m => MonadFix (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

mfix :: (a -> Tracable False w m a) -> Tracable False w m a #

(Monoid w, MonadFix m) => MonadFix (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

mfix :: (a -> Tracable True w m a) -> Tracable True w m a #

MonadFail m => MonadFail (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

fail :: String -> Tracable False w m a #

(Monoid w, MonadFail m) => MonadFail (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

fail :: String -> Tracable True w m a #

Monad m => Applicative (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

pure :: a -> Tracable False w m a #

(<*>) :: Tracable False w m (a -> b) -> Tracable False w m a -> Tracable False w m b #

liftA2 :: (a -> b -> c) -> Tracable False w m a -> Tracable False w m b -> Tracable False w m c #

(*>) :: Tracable False w m a -> Tracable False w m b -> Tracable False w m b #

(<*) :: Tracable False w m a -> Tracable False w m b -> Tracable False w m a #

(Monoid w, Monad m) => Applicative (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

pure :: a -> Tracable True w m a #

(<*>) :: Tracable True w m (a -> b) -> Tracable True w m a -> Tracable True w m b #

liftA2 :: (a -> b -> c) -> Tracable True w m a -> Tracable True w m b -> Tracable True w m c #

(*>) :: Tracable True w m a -> Tracable True w m b -> Tracable True w m b #

(<*) :: Tracable True w m a -> Tracable True w m b -> Tracable True w m a #

(Monoid w, MonadIO m) => MonadIO (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

liftIO :: IO a -> Tracable False w m a #

(Monoid w, MonadIO m) => MonadIO (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

liftIO :: IO a -> Tracable True w m a #

(Monoid w, MonadPlus m) => Alternative (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

empty :: Tracable False w m a #

(<|>) :: Tracable False w m a -> Tracable False w m a -> Tracable False w m a #

some :: Tracable False w m a -> Tracable False w m [a] #

many :: Tracable False w m a -> Tracable False w m [a] #

(Monoid w, MonadPlus m) => Alternative (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

empty :: Tracable True w m a #

(<|>) :: Tracable True w m a -> Tracable True w m a -> Tracable True w m a #

some :: Tracable True w m a -> Tracable True w m [a] #

many :: Tracable True w m a -> Tracable True w m [a] #

(Monoid w, MonadPlus m) => MonadPlus (Tracable False w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

mzero :: Tracable False w m a #

mplus :: Tracable False w m a -> Tracable False w m a -> Tracable False w m a #

(Monoid w, MonadPlus m) => MonadPlus (Tracable True w m) Source # 
Instance details

Defined in Data.Cache.Trace

Methods

mzero :: Tracable True w m a #

mplus :: Tracable True w m a -> Tracable True w m a -> Tracable True w m a #

newtype Tracable False w m a Source # 
Instance details

Defined in Data.Cache.Trace

newtype Tracable False w m a = UntracedT {}
newtype Tracable True w m a Source # 
Instance details

Defined in Data.Cache.Trace

newtype Tracable True w m a = TracedT {}