data-effects-0.1.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Effect.State

Description

 

Documentation

data State s a where Source #

Constructors

Get :: State s s 
Put :: s -> State s () 

type LState s = LiftIns (State s) Source #

pattern LPut :: () => a ~ () => s -> LiftIns (State s) f a Source #

pattern LGet :: () => a ~ s => LiftIns (State s) f a Source #

put'' :: forall key (s :: Type) f. SendInsBy key (State s) f => s -> f () Source #

put' :: forall tag (s :: Type) f. SendIns (Tag (State s) tag) f => s -> f () Source #

put :: forall (s :: Type) f. SendIns (State s) f => s -> f () Source #

get'' :: forall key (s :: Type) f. SendInsBy key (State s) f => f s Source #

get' :: forall tag (s :: Type) f. SendIns (Tag (State s) tag) f => f s Source #

get :: forall (s :: Type) f. SendIns (State s) f => f s Source #

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

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