[project @ 2002-04-26 13:34:05 by simonmar]
[packages/old-locale.git] / Data / Array / MArray.hs
1 {-# OPTIONS -monly-3-regs #-}
2 -----------------------------------------------------------------------------
3 -- |
4 -- Module : Data.Array.MArray
5 -- Copyright : (c) The University of Glasgow 2001
6 -- License : BSD-style (see the file libraries/core/LICENSE)
7 --
8 -- Maintainer : libraries@haskell.org
9 -- Stability : experimental
10 -- Portability : non-portable
11 --
12 -- Class of mutable arrays, and operations on them.
13 --
14 -----------------------------------------------------------------------------
15
16 module Data.Array.MArray (
17 module Data.Ix,
18
19 -- Class of mutable array types
20 MArray, -- :: (* -> * -> *) -> * -> (* -> *) -> class
21 -- Class of array types with immutable bounds
22 HasBounds, -- :: (* -> * -> *) -> class
23
24 newArray, -- :: (MArray a e m, Ix i) => (i,i) -> e -> m (a i e)
25 newArray_, -- :: (MArray a e m, Ix i) => (i,i) -> m (a i e)
26 newListArray, -- :: (MArray a e m, Ix i) => (i,i) -> [e] -> m (a i e)
27 readArray, -- :: (MArray a e m, Ix i) => a i e -> i -> m e
28 writeArray, -- :: (MArray a e m, Ix i) => a i e -> i -> e -> m ()
29 bounds, -- :: (HasBounds a, Ix i) => a i e -> (i,i)
30 indices, -- :: (HasBounds a, Ix i) => a i e -> [i]
31 getElems, -- :: (MArray a e m, Ix i) => a i e -> m [e]
32 getAssocs, -- :: (MArray a e m, Ix i) => a i e -> m [(i, e)]
33 mapArray, -- :: (MArray a e' m, MArray a e m, Ix i) => (e' -> e) -> a i e' -> m (a i e)
34 mapIndices, -- :: (MArray a e m, Ix i, Ix j) => (i,i) -> (i -> j) -> a j e -> m (a i e)
35
36 freeze, -- :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)
37 unsafeFreeze, -- :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)
38 thaw, -- :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)
39 unsafeThaw, -- :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)
40 ) where
41
42 import Prelude
43
44 import Data.Ix
45 import Data.Array.Base