Commit 5dc28ba5 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

Add Eq instances for TrName, Module

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3227
parent 1db71f59
......@@ -58,6 +58,7 @@ import GHC.Magic ()
import GHC.IntWord64
import GHC.Prim
import GHC.Tuple
import GHC.CString (unpackCString#)
import GHC.Types
#include "MachDeps.h"
......@@ -171,6 +172,15 @@ instance (Eq a) => Eq [a] where
(x:xs) == (y:ys) = x == y && xs == ys
_xs == _ys = False
deriving instance Eq Module
instance Eq TrName where
TrNameS a == TrNameS b = isTrue# (a `eqAddr#` b)
a == b = toString a == toString b
where
toString (TrNameS s) = unpackCString# s
toString (TrNameD s) = s
deriving instance Eq Bool
deriving instance Eq Ordering
......
......@@ -7,7 +7,7 @@ T5095.hs:9:9: error:
instance Eq Integer
-- Defined in ‘integer-gmp-1.0.0.1:GHC.Integer.Type’
...plus 23 others
...plus three instances involving out-of-scope types
...plus five instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
(The choice depends on the instantiation of ‘a’
To pick the first instance above, use IncoherentInstances
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment