data-effects-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Data.Effect.State

Description

 

Documentation

data State s a where Source #

Constructors

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

type LState s = LiftFOE (State s) Source #

pattern LPut :: forall a s f. () => (a ~ (), ()) => s -> LiftFOE (State s) f a Source #

pattern LGet :: forall a s f. () => (a ~ s, ()) => LiftFOE (State s) f a Source #

get :: SendFOE (State s) f => f s Source #

get' :: forall {k} (tag :: k) s f. SendFOE (Tag (State s) tag) f => f s Source #

get'' :: forall {k} (key :: k) s f. SendFOEBy key (State s) f => f s Source #

put :: SendFOE (State s) f => s -> f () Source #

put' :: forall {k} (tag :: k) s f. SendFOE (Tag (State s) tag) f => s -> f () Source #

put'' :: forall {k} (key :: k) s f. SendFOEBy key (State s) f => s -> f () Source #

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

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