HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulefused-effects-1.1.2.7Haskell2010

Control.Carrier.State.IORef

A carrier for the State effect. It uses an IORef internally to handle its state, and thus admits a MonadUnliftIO instance. Because the state operations are performed impurely, this carrier will not lose state effects even with nefarious uses of liftWith.

Unlike the other carriers for State, this carrier's effects will not backtrack when run in conjuction with Control.Effect.NonDet effects.

  • 1 type
  • 4 values

Impure state carrier

5 declarations
valuerunStateRef :: MonadIO m => IORef s -> StateC s m a -> m (s, a)
#

Run a State effect starting from the passed IORef. This function is lawless, given that the underlying IORef can be modified by another thread.

newtypenewtype StateC s (m :: Type -> Type) a
#

Constructors

Instances11MonadTrans, Monad, Functor, MonadFix, MonadFail, Applicative, …

State effect

0 declarations