open-witness-0.1.1: open witnesses

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) -> aSource

fixST :: (a -> ST s a) -> ST s aSource

Converting ST to OW and IO

stToOW :: ST s a -> OW s aSource

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 aSource

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

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