Provide access to a mutable value of type s.
Instances1DispatchOf
type DispatchOf (State s) = 'DynamicDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect.Dynamic
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11
Moduleeffectful-core-2.7.1.2GHC2021
Provide access to a mutable value of type s.
type DispatchOf (State s) = 'DynamicDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect.DynamicrunStateLocal :: HasCallStack=> sThe initial state.
-> Eff (Labeled label (State s) ': es) a-> Eff es (a, s)Run the State effect with the given initial state and return the final value along with the final state (via Effectful.State.Static.Local).
evalStateLocal :: HasCallStack=> sThe initial state.
-> Eff (Labeled label (State s) ': es) a-> Eff es aRun the State effect with the given initial state and return the final value, discarding the final state (via Effectful.State.Static.Local).
execStateLocal :: HasCallStack=> sThe initial state.
-> Eff (Labeled label (State s) ': es) a-> Eff es sRun the State effect with the given initial state and return the final state, discarding the final value (via Effectful.State.Static.Local).
Fetch the current value of the state.
Set the current state to the given value.
Apply the function to the current state and return a value.
Deprecated. Use a combination of get and put instead.
Apply the monadic function to the current state and return a value.
Assign a label to an effect.
Note: labeled effects are best used together with the effectful-plugin package, as it significantly improves their usability.
The constructor is for sending labeled operations of a dynamically dispatched effect to the handler:
import Effectful.Dispatch.Dynamic:{ data X :: Effect where X :: X m Int type instance DispatchOf X = Dynamic:}
:{ runPureEff . runLabeled @"x" (interpret_ $ \X -> pure 333) $ do send $ Labeled @"x" X:}333
type DispatchOf (Labeled label e) = DispatchOf eDefined in effectful-core-2.7.1.2 · Effectful.Labeleddata StaticRep (Labeled label e)Defined in effectful-core-2.7.1.2 · Effectful.Labeled