Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Effectful.Colog
Synopsis
- data Log msg m a
- type LogEff es msg = LogAction (Eff es) msg
- logMsg :: forall msg es. Log msg :> es => msg -> Eff es ()
- injectLog :: forall (xs :: [Effect]) (es :: [Effect]) a. Subset xs es => LogEff xs a -> LogEff es a
- runLogAction :: forall es msg a. LogEff es msg -> Eff (Log msg : es) a -> Eff es a
- runLogWriter :: forall es msg a. Monoid msg => Eff (Log msg : es) a -> Eff es (a, msg)
- tellLogEff :: forall es msg. (Writer msg :> es, Monoid msg) => LogEff es msg
- byteStringLogEff :: forall es. FileSystem :> es => Handle -> LogEff es ByteString
- textLogEff :: forall es. FileSystem :> es => Handle -> LogEff es Text
- module Colog.Core.Action
Effect
Provides the ability to log with an implicit LogEff
Instances
type DispatchOf (Log msg) Source # | |
Defined in Effectful.Colog | |
data StaticRep (Log msg) Source # | |
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 #
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
LogAction
s
FileSystem
constrained
byteStringLogEff :: forall es. FileSystem :> es => Handle -> LogEff es ByteString Source #
LogEff
that writes ByteString
to a Handle
textLogEff :: forall es. FileSystem :> es => Handle -> LogEff es Text Source #
Re-exports
module Colog.Core.Action