json-tracer-0.0.3.0: A polymorphic, type-safe, json-structured tracing library

Copyright(c) Taku Terao 2017
LicenseBSD3
Maintainerautotaker@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Control.Monad.CTrace

Description

Contextual tracing monad, mtl-compatible.

Synopsis

Documentation

class Monad m => MonadTrace c m | m -> c where Source #

contextual tracing monad

Minimal complete definition

update, zoom'

Methods

update :: (c -> c) -> m () Source #

Apply the specified function to the tracing context

zoom' :: ASetter' c c -> m a -> m a Source #

monomorphic version of zoom operation

Instances

MonadTrace c m => MonadTrace c (MaybeT m) Source # 

Methods

update :: (c -> c) -> MaybeT m () Source #

zoom' :: ASetter' c c -> MaybeT m a -> MaybeT m a Source #

MonadTrace c m => MonadTrace c (ListT m) Source # 

Methods

update :: (c -> c) -> ListT m () Source #

zoom' :: ASetter' c c -> ListT m a -> ListT m a Source #

MonadTrace c m => MonadTrace c (StateT s m) Source # 

Methods

update :: (c -> c) -> StateT s m () Source #

zoom' :: ASetter' c c -> StateT s m a -> StateT s m a Source #

MonadTrace c m => MonadTrace c (StateT s m) Source # 

Methods

update :: (c -> c) -> StateT s m () Source #

zoom' :: ASetter' c c -> StateT s m a -> StateT s m a Source #

MonadTrace c m => MonadTrace c (IdentityT * m) Source # 

Methods

update :: (c -> c) -> IdentityT * m () Source #

zoom' :: ASetter' c c -> IdentityT * m a -> IdentityT * m a Source #

MonadTrace c m => MonadTrace c (ExceptT e m) Source # 

Methods

update :: (c -> c) -> ExceptT e m () Source #

zoom' :: ASetter' c c -> ExceptT e m a -> ExceptT e m a Source #

(Monoid w, MonadTrace c m) => MonadTrace c (WriterT w m) Source # 

Methods

update :: (c -> c) -> WriterT w m () Source #

zoom' :: ASetter' c c -> WriterT w m a -> WriterT w m a Source #

(Monoid w, MonadTrace c m) => MonadTrace c (WriterT w m) Source # 

Methods

update :: (c -> c) -> WriterT w m () Source #

zoom' :: ASetter' c c -> WriterT w m a -> WriterT w m a Source #

MonadIO m => MonadTrace c (TracerT c m) Source # 

Methods

update :: (c -> c) -> TracerT c m () Source #

zoom' :: ASetter' c c -> TracerT c m a -> TracerT c m a Source #

MonadTrace c m => MonadTrace c (ContT * r m) Source # 

Methods

update :: (c -> c) -> ContT * r m () Source #

zoom' :: ASetter' c c -> ContT * r m a -> ContT * r m a Source #

MonadTrace c m => MonadTrace c (ReaderT * r m) Source # 

Methods

update :: (c -> c) -> ReaderT * r m () Source #

zoom' :: ASetter' c c -> ReaderT * r m a -> ReaderT * r m a Source #

(Monoid w, MonadTrace c m) => MonadTrace c (RWST r w s m) Source # 

Methods

update :: (c -> c) -> RWST r w s m () Source #

zoom' :: ASetter' c c -> RWST r w s m a -> RWST r w s m a Source #

(Monoid w, MonadTrace c m) => MonadTrace c (RWST r w s m) Source # 

Methods

update :: (c -> c) -> RWST r w s m () Source #

zoom' :: ASetter' c c -> RWST r w s m a -> RWST r w s m a Source #

data TracerT c m a Source #

Contextual tracing monad transformer type. Tracing context c can be modified through this monad.

Instances

MonadRWS r w s m => MonadRWS r w s (TracerT c m) Source # 
MonadWriter w m => MonadWriter w (TracerT c m) Source # 

Methods

writer :: (a, w) -> TracerT c m a #

tell :: w -> TracerT c m () #

listen :: TracerT c m a -> TracerT c m (a, w) #

pass :: TracerT c m (a, w -> w) -> TracerT c m a #

MonadState s m => MonadState s (TracerT c m) Source # 

Methods

get :: TracerT c m s #

put :: s -> TracerT c m () #

state :: (s -> (a, s)) -> TracerT c m a #

MonadReader r m => MonadReader r (TracerT c m) Source # 

Methods

ask :: TracerT c m r #

local :: (r -> r) -> TracerT c m a -> TracerT c m a #

reader :: (r -> a) -> TracerT c m a #

MonadError e m => MonadError e (TracerT c m) Source # 

Methods

throwError :: e -> TracerT c m a #

catchError :: TracerT c m a -> (e -> TracerT c m a) -> TracerT c m a #

MonadIO m => MonadTrace c (TracerT c m) Source # 

Methods

update :: (c -> c) -> TracerT c m () Source #

zoom' :: ASetter' c c -> TracerT c m a -> TracerT c m a Source #

MonadTrans (TracerT c) Source # 

Methods

lift :: Monad m => m a -> TracerT c m a #

Monad m => Monad (TracerT c m) Source # 

Methods

(>>=) :: TracerT c m a -> (a -> TracerT c m b) -> TracerT c m b #

(>>) :: TracerT c m a -> TracerT c m b -> TracerT c m b #

return :: a -> TracerT c m a #

fail :: String -> TracerT c m a #

Functor m => Functor (TracerT c m) Source # 

Methods

fmap :: (a -> b) -> TracerT c m a -> TracerT c m b #

(<$) :: a -> TracerT c m b -> TracerT c m a #

MonadFix m => MonadFix (TracerT c m) Source # 

Methods

mfix :: (a -> TracerT c m a) -> TracerT c m a #

Applicative m => Applicative (TracerT c m) Source # 

Methods

pure :: a -> TracerT c m a #

(<*>) :: TracerT c m (a -> b) -> TracerT c m a -> TracerT c m b #

liftA2 :: (a -> b -> c) -> TracerT c m a -> TracerT c m b -> TracerT c m c #

(*>) :: TracerT c m a -> TracerT c m b -> TracerT c m b #

(<*) :: TracerT c m a -> TracerT c m b -> TracerT c m a #

MonadIO m => MonadIO (TracerT c m) Source # 

Methods

liftIO :: IO a -> TracerT c m a #

MonadCont m => MonadCont (TracerT c m) Source # 

Methods

callCC :: ((a -> TracerT c m b) -> TracerT c m a) -> TracerT c m a #

zoom :: ASetter' c c' -> TracerT c' m a -> TracerT c m a Source #

Change the tracing context.

mapTracerT :: (m a -> n b) -> TracerT c m a -> TracerT c n b Source #

Transform the base monad

runTracerT :: ((c -> c) -> IO ()) -> TracerT c m a -> m a Source #

Run the tracer monad with the specified update action.

noTracerT :: Monad m => TracerT c m a -> m a Source #

Run the tracer monad without tracing.

ioTracerT :: MonadIO m => c -> TracerT c m a -> m (a, c) Source #

Run the tracer monad with update action implemented by IORef