effect-monad-0.6.1: Embeds effect systems into Haskell using parameteric effect monads

Safe HaskellNone
LanguageHaskell98

Control.Effect.Update

Synopsis

Documentation

data Eff w where Source

Parametric effect update monad. A bit like a writer monad specialised to the Maybe monoid, providing a single memory cell that can be updated, but with heterogeneous behaviour. Provides an effect system that explains whether a single memory cell has been updated or not

Constructors

Put :: a -> Eff (Just a) 
NoPut :: Eff Nothing 

data Update w a Source

Constructors

Update 

Fields

runUpdate :: (a, Eff w)
 

Instances

Effect (Maybe *) Update 
type Unit (Maybe *) Update = Nothing * 
type Inv (Maybe *) Update s t = () 
type Plus (Maybe *) Update s (Nothing *) = s 
type Plus (Maybe *) Update s (Just * t) = Just * t 

put :: a -> Update (Just a) () Source

Update the memory cell with a new value of type a