HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelinear-base-0.4.0Haskell2010

Control.Functor.Linear.Internal.State

  • 2 types
  • 16 values
newtypenewtype StateT s (m :: Type -> Type) a
#

A (strict) linear state monad transformer.

Constructors

Instances6MonadTrans, Monad, Functor, Applicative
  • MonadTrans (StateT s)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
  • Monad m => Applicative (StateT s m)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
  • Functor m => Functor (StateT s m)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
  • Monad m => Monad (StateT s m)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
  • Functor m => Functor (StateT s m)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
  • Monad m => Applicative (StateT s m)Defined in linear-base-0.4.0 · Control.Functor.Linear.Internal.State
valuereplace :: Applicative m => s %1 -> StateT s m s
#

replace s will replace the current state with the new given state, and return the old state.

valueevalState :: Consumable s => State s a %1 -> s %1 -> a
#

Use with care! This consumes the final state, so might be costly at runtime.

Orphan instances

1 instance