classy-effects-0.1.0.0: An interface for a handler-independent, typeclass-based effect system.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Effect.Class.State

Description

 

Documentation

class State s f where Source #

Methods

get :: f s Source #

put :: s -> f () Source #

Instances

Instances details
SendIns (StateI s) f => State s (EffectsVia EffectDataHandler f) Source # 
Instance details

Defined in Control.Effect.Class.State

data StateI (s :: Type) (a :: Type) where Source #

Constructors

Get :: forall s. StateI s s 
Put :: forall s. s -> StateI s () 

pattern PutS :: () => a_6989586621679050567 ~ () => s -> LiftIns (StateI s) f a_6989586621679050567 Source #

pattern GetS :: () => a_6989586621679050565 ~ s => LiftIns (StateI s) f a_6989586621679050565 Source #

gets :: (State s f, Functor f) => (s -> a) -> f a Source #

modify :: (State s m, Monad m) => (s -> s) -> m () Source #