% -----------------------------------------------------------------------------
-% $Id: PrelByteArr.lhs,v 1.11 2001/02/20 18:40:54 qrczak Exp $
+% $Id: PrelByteArr.lhs,v 1.14 2001/05/18 16:54:05 simonmar Exp $
%
% (c) The University of Glasgow, 1994-2000
%
module PrelByteArr where
import {-# SOURCE #-} PrelErr ( error )
+import PrelNum
import PrelArr
import PrelFloat
import PrelST
import PrelBase
-import PrelNum ( fromInt )
\end{code}
%*********************************************************
%* *
%*********************************************************
-Idle ADR question: What's the tradeoff here between flattening these
-datatypes into @MutableArray ix ix (MutableArray# s elt)@ and using
-it as is? As I see it, the former uses slightly less heap and
-provides faster access to the individual parts of the bounds while the
-code used has the benefit of providing a ready-made @(lo, hi)@ pair as
-required by many array-related functions. Which wins? Is the
-difference significant (probably not).
-
-Idle AJG answer: When I looked at the outputted code (though it was 2
-years ago) it seems like you often needed the tuple, and we build
-it frequently. Now we've got the overloading specialiser things
-might be different, though.
-
\begin{code}
newCharArray, newIntArray, newFloatArray, newDoubleArray
:: Ix ix => (ix,ix) -> ST s (MutableByteArray s ix)