X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fstd%2FPrelMarshalArray.lhs;h=d9ec16d6389b4185b575847fbecd63357ee2be02;hb=f1a7474164cebbb19da431a18da6ebcbbd37733f;hp=2f2a3d4283e4bdd9f5f1ea7a935a4e63e2df1275;hpb=2a6c55eb470c3359fa67d2eed5f47194ff368e51;p=ghc-hetmet.git diff --git a/ghc/lib/std/PrelMarshalArray.lhs b/ghc/lib/std/PrelMarshalArray.lhs index 2f2a3d4..d9ec16d 100644 --- a/ghc/lib/std/PrelMarshalArray.lhs +++ b/ghc/lib/std/PrelMarshalArray.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelMarshalArray.lhs,v 1.6 2001/08/15 09:24:47 simonmar Exp $ +% $Id: PrelMarshalArray.lhs,v 1.7 2001/08/15 09:28:58 simonmar Exp $ % % (c) The FFI task force, 2000 % @@ -126,8 +126,8 @@ reallocArray0 ptr size = reallocArray ptr (size + 1) -- needed linear stack space. -- peekArray :: Storable a => Int -> Ptr a -> IO [a] -peekArray size ptr | size < 0 = return [] - | othwerwise = f (size-1) [] +peekArray size ptr | size < 0 = return [] + | otherwise = f (size-1) [] where f 0 acc = do e <- peekElemOff ptr 0; return (e:acc) f n acc = do e <- peekElemOff ptr n; f (n-1) (e:acc)