HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleghc-10.0.0.20260917GHC2024

GHC.Utils.Monad.State.Strict

A state monad which is strict in its state.

Contents
  1. The State monad
  2. Operations
Synopsis

The State monad

newtypenewtype State s a

A state monad which is strict in the state s, but lazy in the value a.

See Note [Strict State monad] for the particular notion of strictness and implementation details.

Constructors

  • State'
    • runState' :: s -> (# a, s #)
Instances4MonadGetUnique, Monad, Functor, Applicative
  • MonadGetUnique SpillMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.Spill
  • Monad (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.Strict
  • Functor (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.Strict
  • Applicative (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.Strict
patternpattern State :: (s -> (# a, s #)) -> State s a
#

Operations