------------------------------------------------------------------------------- |-- Module : Data.STRef.Lazy-- Copyright : (c) The University of Glasgow 2001-- License : BSD-style (see the file libraries/base/LICENSE)---- Maintainer : libraries@haskell.org-- Stability : stable-- Portability : non-portable (uses Control.Monad.ST.Lazy)---- Mutable references in the lazy ST monad.-------------------------------------------------------------------------------module Data.STRef.Lazy ( -- * STRefs ST.STRef, -- abstract newSTRef, readSTRef, writeSTRef, modifySTRef ) whereimport qualified Prelude (); import MiniPreludeimport Control.Monad.ST.Lazyimport qualified Data.STRef as STnewSTRef :: a -> ST s (ST.STRef s a)readSTRef :: ST.STRef s a -> ST s awriteSTRef :: ST.STRef s a -> a -> ST s ()modifySTRef :: ST.STRef s a -> (a -> a) -> ST s ()newSTRef = strictToLazyST . ST.newSTRefreadSTRef = strictToLazyST . ST.readSTRefwriteSTRef r a = strictToLazyST (ST.writeSTRef r a)modifySTRef r f = strictToLazyST (ST.modifySTRef r f)