| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Effectful.ReturnWith.Dynamic
Contents
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
- data ReturnWith r :: Effect where
- ReturnWith :: r -> ReturnWith r m a
- runReturnWith :: HasCallStack => Eff (ReturnWith r : es) r -> Eff es r
- returnWith :: (HasCallStack, ReturnWith r :> es) => r -> Eff es a
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
| type DispatchOf (ReturnWith r) Source # | |
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
Arguments
| :: (HasCallStack, ReturnWith r :> es) | |
| => r | The value. |
| -> Eff es a |
Return early with the given value.