λ HASKELL SIGILS DIFFICULTY: Adept Behavioral

The State

Modeling mutable planes with the State Monad.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Flux
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PURE FUNCTIONAL VOID SIGIL //
module StatePattern where
import Control.Monad.State
type MachineState = String
transition :: State MachineState ()
transition = modify (\s -> s ++ " transitioned")
Runic Tags: #state-monad #behavioral