effet-0.4.0.0: An Effect System based on Type Classes

Control.Effect.RWS.Lazy

Description

Lazy interpretations of the RWS' effect.

If you don't require disambiguation of multiple RWS effects (i.e., you only have one RWS effect in your monadic context), you usually need the untagged interpretations.

Synopsis

# Tagged Interpretations

Arguments

 :: forall tag r w s m a. Functor m => r The initial environment. -> s The initial state. -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] EachVia RWST r w s) m a The program whose RWS effect should be handled. -> m (w, a) The program with its RWS effect handled, producing the final output w and the result a.

Runs the RWS effect and discards the final state.

Arguments

 :: forall tag r w s m a. Functor m => r The initial environment. -> s The initial state. -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] EachVia RWST r w s) m a The program whose RWS effect should be handled. -> m (w, s) The program with its RWS effect handled, producing the final output w and the final state s.

Runs the RWS effect and discards the result of the interpreted program.

Arguments

 :: forall tag r w s m a. Functor m => r The initial environment. -> s The initial state. -> ('[RWS' tag r w s, Reader' tag r, Writer' tag w, State' tag s] EachVia RWST r w s) m a The program whose RWS effect should be handled. -> m (w, s, a) The program with its RWS effect handled, producing the final output w, the final state s and the result a.

Runs the RWS effect and returns the final output, the final state and the result of the interpreted program.

# Untagged Interpretations

evalRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] EachVia RWST r w s) m a -> m (w, a) Source #

execRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] EachVia RWST r w s) m a -> m (w, s) Source #

runRWS :: Functor m => r -> s -> ('[RWS r w s, Reader r, Writer w, State s] EachVia RWST r w s) m a -> m (w, s, a) Source #