open-witness-0.6: open witnesses
Safe HaskellNone
LanguageHaskell2010

Data.Type.OpenWitness.ST

Description

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

Synopsis

The ST Monad

type ST s = StateT (WitnessMapOf (OpenWitness s :: Type -> Type)) (OW s) Source #

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

type STRef s = OpenWitness s :: k -> Type Source #

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

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

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

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