persistent-refs-0.1: Haskell references backed by an IntMap for persistence and reversibility.

Portabilitynon-portable (requires rank-2 types for runST)
Stabilityexperimental
Maintaineracfoltzer@gmail.com
Safe HaskellNone

Control.Monad.ST.Persistent

Contents

Description

This library provides support for a persistent version of the ST monad. Internally, references are backed by a IntMap, rather than being mutable variables on the heap. This decreases performance, but can be useful in certain settings, particularly those involving backtracking.

Synopsis

The Persistent ST Monad

data ST s a Source

A persistent version of the ST monad.

Instances

Monad (ST s) 
Functor (ST s) 
Applicative (ST s) 
MonadRef (STRef s) (ST s) 

runST :: (forall s. ST s a) -> aSource

Run a computation that uses persistent references, and return a pure value. The rank-2 type offers similar guarantees to runST.