[project @ 2002-11-08 09:04:35 by simonpj]
[ghc-base.git] / Data / Array / ST.hs
index 143f792..cd81d83 100644 (file)
@@ -1,35 +1,48 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  Data.Array.ST
 -- Copyright   :  (c) The University of Glasgow 2001
--- License     :  BSD-style (see the file libraries/core/LICENSE)
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
 -- 
 -- Maintainer  :  libraries@haskell.org
 -- Stability   :  experimental
 -- Portability :  non-portable
 --
--- $Id: ST.hs,v 1.1 2001/06/28 14:15:02 simonmar Exp $
---
--- Mutable boxed/unboxed arrays in the ST monad.
+-- Mutable boxed and unboxed arrays in the 'ST' monad.
 --
 -----------------------------------------------------------------------------
 
 module Data.Array.ST (
-   module Data.Array.MArray,
+
+   -- * Boxed arrays
    STArray,            -- instance of: Eq, MArray
+
+#ifdef __GLASGOW_HASKELL__
+   -- * Unboxed arrays
    STUArray,           -- instance of: Eq, MArray
    castSTUArray,       -- :: STUArray s i a -> ST s (STUArray s i b)
+#endif
+
+   -- * Overloaded mutable array interface
+   module Data.Array.MArray,
  ) where
 
 import Prelude
 
 import Data.Array.MArray
-import Data.Array.Base
+#ifdef __HUGS__
+import Hugs.ST
+#else
+import Data.Array.Base hiding (MArray(..))
+#endif
 
 #ifdef __GLASGOW_HASKELL__
 import GHC.Arr
 import GHC.ST
 
+-- | Casts an 'STUArray' with one element type into one with a
+-- different element type.  All the elements of the resulting array
+-- are undefined (unless you know what you\'re doing...).
 castSTUArray :: STUArray s ix a -> ST s (STUArray s ix b)
 castSTUArray (STUArray l u marr#) = return (STUArray l u marr#)
 #endif