x == y = not (x /= y)
-- XXX This doesn't work:
+-- deriving instance Eq Bool
+-- <wired into compiler>:
+-- Illegal binding of built-in syntax: con2tag_Bool#
+instance Eq Bool where
+ True == True = True
+ False == False = True
+ _ == _ = False
+
+-- XXX This doesn't work:
-- deriving instance Eq Ordering
-- Illegal binding of built-in syntax: con2tag_Ordering#
instance Eq Ordering where
min x y = if x <= y then x else y
-- XXX This doesn't work:
+-- deriving instance Ord Bool
+-- <wired into compiler>:
+-- Illegal binding of built-in syntax: con2tag_Bool#
+instance Ord Bool where
+ compare False True = LT
+ compare True False = GT
+ compare _ _ = EQ
+
+-- XXX This doesn't work:
-- deriving instance Ord Ordering
-- Illegal binding of built-in syntax: con2tag_Ordering#
instance Ord Ordering where