effectful-core
Safe HaskellSafe-Inferred
LanguageGHC2021

Effectful.ReturnWith.Dynamic

Description

The dynamically dispatched variant of the ReturnWith effect.

Note: unless you plan to change interpretations at runtime, it's recommended to use the statically dispatched variant, i.e. Effectful.ReturnWith.Static.

All caveats described in Effectful.ReturnWith.Static (in particular the interaction with threads) apply.

Since: 2.7.0.0

Synopsis

Effect

data ReturnWith r :: Effect where Source #

Provide the ability to return early with a value of type r.

Constructors

ReturnWith :: r -> ReturnWith r m a 

Instances

Instances details
type DispatchOf (ReturnWith r) Source # 
Instance details

Defined in Effectful.ReturnWith.Dynamic

Handlers

runReturnWith :: HasCallStack => Eff (ReturnWith r : es) r -> Eff es r Source #

Run a computation that can return early with a value of type r (via Effectful.ReturnWith.Static).

Operations

returnWith Source #

Arguments

:: (HasCallStack, ReturnWith r :> es) 
=> r

The value.

-> Eff es a 

Return early with the given value.