classy-effects-0.1.0.1: 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

Methods

get :: EffectsVia EffectDataHandler f s Source #

put :: s -> EffectsVia EffectDataHandler f () Source #

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

Constructors

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

type StateS s = LiftIns (StateI s) Source #

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

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

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

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