add install-includes: field
[packages/pretty.git] / Data / Array / MArray.hs
1 -----------------------------------------------------------------------------
2 -- |
3 -- Module : Data.Array.MArray
4 -- Copyright : (c) The University of Glasgow 2001
5 -- License : BSD-style (see the file libraries/base/LICENSE)
6 --
7 -- Maintainer : libraries@haskell.org
8 -- Stability : experimental
9 -- Portability : non-portable (uses Data.Array.Base)
10 --
11 -- An overloaded interface to mutable arrays. For array types which can be
12 -- used with this interface, see "Data.Array.IO", "Data.Array.ST",
13 -- and "Data.Array.Storable".
14 --
15 -----------------------------------------------------------------------------
16
17 module Data.Array.MArray (
18 -- * Class of mutable array types
19 MArray, -- :: (* -> * -> *) -> * -> (* -> *) -> class
20
21 -- * The @Ix@ class and operations
22 module Data.Ix,
23
24 -- * Constructing mutable arrays
25 newArray, -- :: (MArray a e m, Ix i) => (i,i) -> e -> m (a i e)
26 newArray_, -- :: (MArray a e m, Ix i) => (i,i) -> m (a i e)
27 newListArray, -- :: (MArray a e m, Ix i) => (i,i) -> [e] -> m (a i e)
28
29 -- * Reading and writing mutable arrays
30 readArray, -- :: (MArray a e m, Ix i) => a i e -> i -> m e
31 writeArray, -- :: (MArray a e m, Ix i) => a i e -> i -> e -> m ()
32
33 -- * Derived arrays
34 mapArray, -- :: (MArray a e' m, MArray a e m, Ix i) => (e' -> e) -> a i e' -> m (a i e)
35 mapIndices, -- :: (MArray a e m, Ix i, Ix j) => (i,i) -> (i -> j) -> a j e -> m (a i e)
36
37 -- * Deconstructing mutable arrays
38 getBounds, -- :: (MArray a e m, Ix i) => a i e -> m (i,i)
39 getElems, -- :: (MArray a e m, Ix i) => a i e -> m [e]
40 getAssocs, -- :: (MArray a e m, Ix i) => a i e -> m [(i, e)]
41
42 -- * Conversions between mutable and immutable arrays
43 freeze, -- :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)
44 unsafeFreeze, -- :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)
45 thaw, -- :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)
46 unsafeThaw, -- :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)
47 ) where
48
49 import Prelude
50
51 import Data.Ix
52 #ifdef __HADDOCK__
53 import Data.Array.IArray
54 #endif
55 import Data.Array.Base