Pugs.Types defined an Eq instance for Control.Concurrent.STM.TMVar (from

the stm package), which is no longer possible, because TMVar is deriving
Eq now. So move the (somewhat crude)  comparision based on addressOf (which
comes from the hs-pugs-compat package) into Pugs.AST.Types, providing an
explicit Eq instance for VThread.

IMHO, instance declarations for standard type classes on types imported
from other Haskell packages are evil.

Breakage noticed by naddy@.

While here, update WANTLIB and bump.
This commit is contained in:
kili 2010-09-14 18:58:01 +00:00
parent 5ed6c2a9cc
commit 8836c64046
3 changed files with 31 additions and 3 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.3 2010/07/17 13:54:30 kili Exp $
# $OpenBSD: Makefile,v 1.4 2010/09/14 18:58:01 kili Exp $
COMMENT = Perl 6 Implementation
DISTNAME = Pugs-6.2.13.15
REVISION = 0
REVISION = 1
CATEGORIES = lang devel
HOMEPAGE = http://pugscode.org/
@ -15,7 +15,7 @@ PERMIT_DISTFILES_FTP = Yes
VMEM_WARNING = Yes
WANTLIB = c gmp m ncurses perl pthread util
WANTLIB = c gmp m ncursesw perl pthread util
MODULES = lang/ghc converters/libiconv

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_Pugs_AST_Types_hs,v 1.1 2010/09/14 18:58:01 kili Exp $
--- src/Pugs/AST/Types.hs.orig Wed Dec 16 15:02:44 2009
+++ src/Pugs/AST/Types.hs Tue Sep 14 20:37:46 2010
@@ -21,7 +21,11 @@ data VThread = MkThread
{ threadId :: ThreadId
, threadLock :: TMVar Val
}
- deriving (Show, Eq, Ord, Typeable)
+ deriving (Show, Ord, Typeable)
+
+instance Eq VThread where
+ v == w = threadId v == threadId w &&
+ addressOf (threadLock v) == addressOf (threadLock w)
data VSubst
= MkSubst

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_Pugs_Types_hs,v 1.1 2010/09/14 18:58:01 kili Exp $
--- src/Pugs/Types.hs.orig Wed Dec 16 15:02:44 2009
+++ src/Pugs/Types.hs Tue Sep 14 20:34:02 2010
@@ -630,8 +630,6 @@ instance (Ord a) => Ord (Tree a) where
compare _ _ = EQ
instance Ord (TMVar a) where
compare x y = compare (addressOf x) (addressOf y)
-instance Eq (TMVar a) where
- x == y = addressOf x == addressOf y
instance Show (TMVar a) where
show = showAddressOf "tmvar"