Portability | non-portable (uses Data.Array.IArray) |
---|---|
Stability | experimental |
Maintainer | libraries@haskell.org |
Safe Haskell | Trustworthy |
Unboxed immutable arrays.
- data UArray i e
- module Data.Array.IArray
Arrays with unboxed elements
Arrays with unboxed elements. Instances of IArray
are provided
for UArray
with certain element types (Int
, Float
, Char
,
etc.; see the UArray
class for a full list).
A UArray
will generally be more efficient (in terms of both time
and space) than the equivalent Array
with the same
element type. However, UArray
is strict in its elements - so
don't use UArray
if you require the non-strictness that
Array
provides.
Because the IArray
interface provides operations overloaded on
the type of the array, it should be possible to just change the
array type being used by a program from say Array
to UArray
to
get the benefits of unboxed arrays (don't forget to import
Data.Array.Unboxed instead of Data.Array).
Typeable2 UArray | |
IArray UArray Bool | |
IArray UArray Char | |
IArray UArray Double | |
IArray UArray Float | |
IArray UArray Int | |
IArray UArray Int8 | |
IArray UArray Int16 | |
IArray UArray Int32 | |
IArray UArray Int64 | |
IArray UArray Word | |
IArray UArray Word8 | |
IArray UArray Word16 | |
IArray UArray Word32 | |
IArray UArray Word64 | |
IArray UArray (StablePtr a) | |
IArray UArray (Ptr a) | |
IArray UArray (FunPtr a) | |
(Ix ix, Eq e, IArray UArray e) => Eq (UArray ix e) | |
(Eq (UArray ix e), Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e) | |
(Ix ix, Show ix, Show e, IArray UArray e) => Show (UArray ix e) |
The overloaded immutable array interface
module Data.Array.IArray