aivika-transformers-2.0: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.ProtoRef

Description

Tested with: GHC 7.8.3

It defines a prototype of mutable references.

Synopsis

Documentation

class (Functor m, Monad m) => ProtoRefMonad m where Source

A monad within which computation we can create and work with the prototype of mutable reference.

Associated Types

data ProtoRef m :: * -> * Source

A prototype of mutable reference.

Methods

newProtoRef :: Session m -> a -> m (ProtoRef m a) Source

Create a new ptototype of mutable reference by the specified session and initial value.

readProtoRef :: ProtoRef m a -> m a Source

Read the contents of the prototype of mutable reference.

writeProtoRef :: ProtoRef m a -> a -> m () Source

Write a new value in the prototype of mutable reference.

modifyProtoRef :: ProtoRef m a -> (a -> a) -> m () Source

Modify a value stored in the prototype of mutable reference.

modifyProtoRef' :: ProtoRef m a -> (a -> a) -> m () Source

A strict version of modifyProtoRef.

Instances