open-witness-0.4.0.1: open witnesses

Safe HaskellNone
LanguageHaskell2010

Data.OpenWitness.ST

Contents

Description

This is an approximate re-implementation of Control.Monad.ST and Data.STRef using open witnesses.

Synopsis

The ST Monad

runST :: (forall s. ST s a) -> a Source #

fixST :: (a -> ST s a) -> ST s a Source #

Converting ST to OW and IO

stToOW :: ST s a -> OW s a Source #

data RealWorld Source #

The s type for running OW in IO.

STRefs

newSTRef :: a -> ST s (STRef s a) Source #

readSTRef :: STRef s a -> ST s a Source #

writeSTRef :: forall s a. STRef s a -> a -> ST s () Source #

modifySTRef :: forall s a. STRef s a -> (a -> a) -> ST s () Source #