Idris2Doc : Log4Types.HasLog

Log4Types.HasLog

(source)
Typeclass-based access to loggers from an environment.

`HasLog` provides a uniform way to extract and modify a `LogAction`
within an environment type. Combined with `MonadReader`, this enables
logging that is polymorphic over the monad - the concrete logger
is determined by the environment.

`LoggerT` is a monad transformer that carries a `LogAction` in a
reader environment. Use `usingLoggerT` to run a `LoggerT` computation
with a concrete `LogAction`.

Reexports

importpublic Control.Monad.Reader.Interface
importpublic Control.Monad.Trans

Definitions

interfaceHasLog : Type->Type-> (Type->Type) ->Type
  Interface for environment types that contain a LogAction.

The `m` parameter is the monad of the stored LogAction and should
match the monad you're running in. This allows `logMsg` to directly
execute the action without lifting.

Parameters: env, msg, m
Methods:
getLogAction : env->LogActionmmsg
  Extract the LogAction from the environment.
setLogAction : LogActionmmsg->env->env
  Replace the LogAction in the environment.

Implementation: 
HasLog (LogActionmmsg) msgm
getLogAction : HasLogenvmsgm=>env->LogActionmmsg
  Extract the LogAction from the environment.

Totality: total
Visibility: public export
setLogAction : HasLogenvmsgm=>LogActionmmsg->env->env
  Replace the LogAction in the environment.

Totality: total
Visibility: public export
logMsg : Monadm=>MonadReaderenvm=>HasLogenvmsgm=>msg->m ()
  Log a message by extracting the action from the reader environment.

Totality: total
Visibility: public export
withLog : Monadm=>MonadReaderenvm=>HasLogenvmsgm=> (LogActionmmsg->LogActionmmsg) ->ma->ma
  Run a computation with a locally modified logger.

Totality: total
Visibility: public export
recordLoggerT : Type-> (Type->Type) ->Type->Type
  A monad transformer that carries a `LogAction` in a reader environment.

The stored `LogAction` is self-referential: it operates in `LoggerT msg m`,
not in the inner monad `m`. This allows the action itself to use the
full `LoggerT` capabilities.

Use `usingLoggerT` to run a `LoggerT` computation.

Totality: total
Visibility: public export
Constructor: 
MkLoggerT : ReaderT (LogAction (LoggerTmsgm) msg) ma->LoggerTmsgma

Projection: 
.unLoggerT : LoggerTmsgma->ReaderT (LogAction (LoggerTmsgm) msg) ma

Hints:
Applicativem=>Applicative (LoggerTmsgm)
Functorm=>Functor (LoggerTmsgm)
HasIOm=>HasIO (LoggerTmsgm)
Monadm=>Monad (LoggerTmsgm)
Monadm=>MonadReader (LogAction (LoggerTmsgm) msg) (LoggerTmsgm)
MonadTrans (LoggerTmsg)
.unLoggerT : LoggerTmsgma->ReaderT (LogAction (LoggerTmsgm) msg) ma
Totality: total
Visibility: public export
unLoggerT : LoggerTmsgma->ReaderT (LogAction (LoggerTmsgm) msg) ma
Totality: total
Visibility: public export
usingLoggerT : Monadm=>LogActionmmsg->LoggerTmsgma->ma
  Run a `LoggerT` computation with a concrete `LogAction`.

The provided `LogAction m msg` (operating in the inner monad) is
lifted to `LogAction (LoggerT msg m) msg` via `lift`.

Totality: total
Visibility: public export