effectful-core
Safe HaskellSafe-Inferred
LanguageGHC2021

Effectful.Input.Dynamic

Description

The dynamically dispatched variant of the Input effect.

Note: unless you plan to change interpretations at runtime, it's recommended to use one of the statically dispatched variants, i.e. Effectful.Input.Static or Effectful.Input.Static.Action.

Since: 2.7.0.0

Synopsis

Effect

data Input i :: Effect where Source #

Provide access to values of type i.

Constructors

Input :: Input i m i 

Instances

Instances details
type DispatchOf (Input i) Source # 
Instance details

Defined in Effectful.Input.Dynamic

Handlers

runInput Source #

Arguments

:: HasCallStack 
=> i

The input value.

-> Eff (Input i : es) a 
-> Eff es a 

Run the Input effect with the given value.

runInputAction Source #

Arguments

:: forall i es a. HasCallStack 
=> (HasCallStack => Eff es i)

The action for input generation.

-> Eff (Input i : es) a 
-> Eff es a 

Run the Input effect with the given action that supplies values.

Operations

input :: (HasCallStack, Input i :> es) => Eff es i Source #

Fetch the value.

inputs Source #

Arguments

:: (HasCallStack, Input i :> es) 
=> (i -> a)

The function to apply to the value.

-> Eff es a 

Fetch the result of applying a function to the value.

inputs f ≡ f <$> input