co-log-effectful-0.0.0.1: effectful log effect using co-log-core
Safe HaskellSafe-Inferred
LanguageGHC2021

Effectful.Colog

Synopsis

Effect

data Log msg m a Source #

Provides the ability to log with an implicit LogEff

Instances

Instances details
type DispatchOf (Log msg) Source # 
Instance details

Defined in Effectful.Colog

data StaticRep (Log msg) Source # 
Instance details

Defined in Effectful.Colog

data StaticRep (Log msg) where

type LogEff es msg = LogAction (Eff es) msg Source #

LogAction limited to the Eff monad

logMsg :: forall msg es. Log msg :> es => msg -> Eff es () Source #

logs a message using the implicit LogEff

injectLog :: forall (xs :: [Effect]) (es :: [Effect]) a. Subset xs es => LogEff xs a -> LogEff es a Source #

converts a LogEff into another compatible LogEff

Handlers

runLogAction :: forall es msg a. LogEff es msg -> Eff (Log msg : es) a -> Eff es a Source #

runs the Log effect using the provided action this is the most general runner

runLogWriter :: forall es msg a. Monoid msg => Eff (Log msg : es) a -> Eff es (a, msg) Source #

runs the Log effect using tellLogEff and then handles the Writer effect

LogActions

tellLogEff :: forall es msg. (Writer msg :> es, Monoid msg) => LogEff es msg Source #

LogEff that delegates to a static shared Writer effect

FileSystem constrained

textLogEff :: forall es. FileSystem :> es => Handle -> LogEff es Text Source #

LogEff that writes Text to a Handle

Re-exports