module Polysemy.Log.Pure where
import Polysemy.Output (Output, output)
import Polysemy.Log.Data.Log (Log(Log))
import Polysemy.Log.Data.LogMessage (LogMessage)
interpretLogOutput ::
Member (Output LogMessage) r =>
InterpreterFor Log r
interpretLogOutput :: forall (r :: EffectRow).
Member (Output LogMessage) r =>
InterpreterFor Log r
interpretLogOutput =
(forall (rInitial :: EffectRow) x. Log (Sem rInitial) x -> Sem r x)
-> Sem (Log : r) a -> Sem r a
forall (e :: (* -> *) -> * -> *) (r :: EffectRow) a.
FirstOrder e "interpret" =>
(forall (rInitial :: EffectRow) x. e (Sem rInitial) x -> Sem r x)
-> Sem (e : r) a -> Sem r a
interpret \case
Log LogMessage
msg -> LogMessage -> Sem r ()
forall o (r :: EffectRow). Member (Output o) r => o -> Sem r ()
output LogMessage
msg
interpretLogNull :: InterpreterFor Log r
interpretLogNull :: forall (r :: EffectRow). InterpreterFor Log r
interpretLogNull =
(forall (rInitial :: EffectRow) x. Log (Sem rInitial) x -> Sem r x)
-> Sem (Log : r) a -> Sem r a
forall (e :: (* -> *) -> * -> *) (r :: EffectRow) a.
FirstOrder e "interpret" =>
(forall (rInitial :: EffectRow) x. e (Sem rInitial) x -> Sem r x)
-> Sem (e : r) a -> Sem r a
interpret \case
Log LogMessage
_ -> () -> Sem r ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()