effet-0.3.0.1: An Effect System based on Type Classes

Copyright(c) Michael Szvetits 2020
LicenseBSD3 (see the file LICENSE)
Maintainertypedbyte@qualified.name
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Control.Effect.RWS.Lazy

Contents

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

evalRWS' Source #

Arguments

:: 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.

execRWS' Source #

Arguments

:: 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.

runRWS' Source #

Arguments

:: 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 #

The untagged version of evalRWS'.

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 #

The untagged version of execRWS'.

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 #

The untagged version of runRWS'.