From: simonpj Date: Mon, 1 Apr 2002 09:19:18 +0000 (+0000) Subject: [project @ 2002-04-01 09:19:18 by simonpj] X-Git-Tag: nhc98-1-18-release~1068 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6a245a639b4c8f95dc3f1e183542b25c6fe1a0cb;hp=3a4a64a72ecf7c8659730edf93f1ff9990172a85;p=ghc-base.git [project @ 2002-04-01 09:19:18 by simonpj] Remove Ix context from STArray data type. Data type contexts are evil. H98 says they even apply for pattern matching, which GHC didn't implement till now --- and that forces Ix even on equality of STArrays. No, no, no. --- diff --git a/GHC/Arr.lhs b/GHC/Arr.lhs index bc8b809..ac43d2b 100644 --- a/GHC/Arr.lhs +++ b/GHC/Arr.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: Arr.lhs,v 1.2 2001/12/21 15:07:22 simonmar Exp $ +% $Id: Arr.lhs,v 1.3 2002/04/01 09:19:18 simonpj Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -278,7 +278,9 @@ instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1,a2,a3,a4,a5) where type IPr = (Int, Int) data Ix i => Array i e = Array !i !i (Array# e) -data Ix i => STArray s i e = STArray !i !i (MutableArray# s e) +data STArray s i e = STArray !i !i (MutableArray# s e) + -- No Ix context for STArray. They are stupid, + -- and force an Ix context on the equality instance. -- Just pointer equality on mutable arrays: instance Eq (STArray s i e) where