{-# LANGUAGE Rank2Types, FlexibleInstances, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Vector.Dense.ST -- Copyright : Copyright (c) , Patrick Perry -- License : BSD3 -- Maintainer : Patrick Perry -- Stability : experimental -- module Data.Vector.Dense.ST ( -- * The @STVector@ data type STVector, runSTVector, unsafeIOVectorToSTVector, unsafeSTVectorToIOVector, module Data.Vector.Dense.Class ) where import Control.Monad.ST import Data.Vector.Dense.Class.Internal( STVector, unsafeIOVectorToSTVector, unsafeSTVectorToIOVector ) import Data.Vector.Dense.Class import Data.Vector.Dense.Internal ( Vector(..) ) runSTVector :: (forall s . ST s (STVector s n e)) -> Vector n e runSTVector x = runST $ x >>= return . V . unsafeSTVectorToIOVector