From 6a245a639b4c8f95dc3f1e183542b25c6fe1a0cb Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 1 Apr 2002 09:19:18 +0000 Subject: [PATCH] [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. --- GHC/Arr.lhs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 1.7.10.4