1 -----------------------------------------------------------------------------
3 -- Module : Data.Array.ST
4 -- Copyright : (c) The University of Glasgow 2001
5 -- License : BSD-style (see the file libraries/base/LICENSE)
7 -- Maintainer : libraries@haskell.org
8 -- Stability : experimental
9 -- Portability : non-portable
11 -- Mutable boxed and unboxed arrays in the 'ST' monad.
13 -----------------------------------------------------------------------------
15 module Data.Array.ST (
18 STArray, -- instance of: Eq, MArray
20 #ifdef __GLASGOW_HASKELL__
22 STUArray, -- instance of: Eq, MArray
23 castSTUArray, -- :: STUArray s i a -> ST s (STUArray s i b)
26 -- * Overloaded mutable array interface
27 module Data.Array.MArray,
32 import Data.Array.MArray
36 import Data.Array.Base hiding (MArray(..))
39 #ifdef __GLASGOW_HASKELL__
43 -- | Casts an 'STUArray' with one element type into one with a
44 -- different element type. All the elements of the resulting array
45 -- are undefined (unless you know what you\'re doing...).
46 castSTUArray :: STUArray s ix a -> ST s (STUArray s ix b)
47 castSTUArray (STUArray l u marr#) = return (STUArray l u marr#)