This types class contains simple pair of getter-setter and related functions. It also provides the useful lens logActionL with the default implementation using type class methods. The default one could be easily overritten under your instances.
Every instance of the this typeclass should satisfy the following laws:
Set-Get:
getLogAction (setLogAction l env) ≡ lGet-Set:
setLogAction (getLogAction env) env ≡ envSet-Set:
setLogAction l2 (setLogAction l1 env) ≡ setLogAction l2 envSet-Over:
overLogAction f env ≡ setLogAction (f $ getLogAction env) env
Methods
getLogAction :: env -> LogAction m msgExtracts LogAction from the environment.
setLogAction :: LogAction m msg -> env -> envSets LogAction to the given one inside the environment.
overLogAction :: (LogAction m msg -> LogAction m msg) -> env -> envApplies function to the LogAction inside the environment.
logActionL :: Lens' env (LogAction m msg)Lens for LogAction inside the environment.