module Data.STRef.Lazy ( STRef, newSTRef, readSTRef, writeSTRef, modifySTRef, ) where import Control.Monad.ST.Lazy (ST, strictToLazyST, ) import Data.STRef.Strict (STRef, ) import qualified Data.STRef.Strict as ST newSTRef :: a -> ST s (STRef s a) readSTRef :: STRef s a -> ST s a writeSTRef :: STRef s a -> a -> ST s () modifySTRef :: STRef s a -> (a -> a) -> ST s () newSTRef = strictToLazyST . ST.newSTRef readSTRef = strictToLazyST . ST.readSTRef writeSTRef r a = strictToLazyST (ST.writeSTRef r a) modifySTRef r f = strictToLazyST (ST.modifySTRef r f)