ref-0.1.1.2: Generic Mutable Ref Abstraction Layer

Safe HaskellNone

Data.Ref

Documentation

class Ref ref whereSource

Associated Types

type RefM ref :: * -> *Source

The monad type associated with a given reference type. eg, IO for IORefs, ST for STRefs. Need to consider if Functional Dependencies will yield better type inference or not.

Methods

newRef :: a -> RefM ref (ref a)Source

newRef' :: a -> RefM ref (ref a)Source

readRef :: ref a -> RefM ref aSource

readRef' :: ref a -> RefM ref aSource

writeRef :: ref a -> a -> RefM ref ()Source

writeRef' :: ref a -> a -> RefM ref ()Source

modifyRef :: ref a -> (a -> a) -> RefM ref ()Source

modifyRef' :: ref a -> (a -> a) -> RefM ref ()Source

Instances