{-# LANGUAGE RankNTypes #-}
module Data.Array.ST (
STArray,
runSTArray,
STUArray,
runSTUArray,
module Data.Array.MArray,
) where
import Data.Array.Base ( STUArray, UArray, unsafeFreezeSTUArray )
import Data.Array.MArray
import Control.Monad.ST ( ST, runST )
import GHC.Arr ( STArray, Array, unsafeFreezeSTArray )
runSTArray :: (Ix i)
=> (forall s . ST s (STArray s i e))
-> Array i e
runSTArray st = runST (st >>= unsafeFreezeSTArray)
runSTUArray :: (Ix i)
=> (forall s . ST s (STUArray s i e))
-> UArray i e
runSTUArray st = runST (st >>= unsafeFreezeSTUArray)