X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fstd%2FPrelArrExtra.lhs;h=85292d8d21471555babd36c2f20cf55b6eff0942;hb=bf79510397bb7e72f1f7f6ea49a618a858d121a7;hp=a7769b88fce8ed10df39fcc5685b5cb94d7da8f2;hpb=6111556816314236f1f7df84b404e6fbc83e739f;p=ghc-hetmet.git diff --git a/ghc/lib/std/PrelArrExtra.lhs b/ghc/lib/std/PrelArrExtra.lhs index a7769b8..85292d8d 100644 --- a/ghc/lib/std/PrelArrExtra.lhs +++ b/ghc/lib/std/PrelArrExtra.lhs @@ -1,6 +1,9 @@ +% ----------------------------------------------------------------------------- +% $Id: PrelArrExtra.lhs,v 1.12 2000/12/12 12:19:58 simonmar Exp $ % -% (c) The AQUA Project, Glasgow University, 1994-1996 +% (c) The University of Glasgow, 1994-2000 % + \section[PrelArrExtra]{Module @PrelArrExtra@} The following functions should be in PrelArr, but need -monly-2-regs @@ -18,7 +21,6 @@ import PrelByteArr import PrelST import PrelIOBase import PrelBase -import PrelGHC \end{code} %********************************************************* @@ -36,7 +38,7 @@ freezeByteArray :: Ix ix => MutableByteArray s ix -> ST s (ByteArray ix) -- only modifies its destination operand, which is already MutableByteArray. freezeByteArray (MutableByteArray l u arr) = ST $ \ s -> let n = sizeofMutableByteArray# arr in - case (newCharArray# n s) of { (# s, newarr #) -> + case (newByteArray# n s) of { (# s, newarr #) -> case ((unsafeCoerce# memcpy) newarr arr n s) of { (# s, () #) -> case unsafeFreezeByteArray# newarr s of { (# s, frozen #) -> (# s, ByteArray l u frozen #) }}}