This library provides support for . In addition to the monad module ST( module ST, module Monad ) where import Monad data ST s a -- abstract type runST :: forall a. (forall s. ST s a) -> a fixST :: (a -> ST s a) -> ST s a unsafeInterleaveST :: ST s a -> ST s a instance Functor (ST s) instance Monad (ST s) data STRef s a -- mutable variables in state thread s -- containing values of type a. newSTRef :: a -> ST s (STRef s a) readSTRef :: STRef s a -> ST s a writeSTRef :: STRef s a -> a -> ST s () instance Eq (STRef s a) data STArray s ix elt -- mutable arrays in state thread s -- indexed by values of type ix -- containing values of type a. newSTArray :: Ix ix => (ix,ix) -> elt -> ST s (STArray s ix elt) boundsSTArray :: Ix ix => STArray s ix elt -> (ix, ix) readSTArray :: Ix ix => STArray s ix elt -> ix -> ST s elt writeSTArray :: Ix ix => STArray s ix elt -> ix -> elt -> ST s () thawSTArray :: Ix ix => Array ix elt -> ST s (STArray s ix elt) freezeSTArray :: Ix ix => STArray s ix elt -> ST s (Array ix elt) unsafeFreezeSTArray :: Ix ix => STArray s ix elt -> ST s (Array ix elt) instance Eq (STArray s ix elt) unsafeIOToST :: IO a -> ST s a stToIO :: ST s a -> IO a Notes: GHC also supports ByteArrays --- these aren't supported by Hugs yet. The operations Note that it is possible to install Hugs 1.4 without support for lazy state threads, and hence the primitives described here may not be available in all implementations. Also, in contrast with the implementation of lazy state threads in previous releases of Hugs and Gofer, there is no direct relationship between the Hugs provides Operations for coercing an