Skip to content

Instantly share code, notes, and snippets.

@fendor
Created August 22, 2020 10:00
Show Gist options
  • Save fendor/60e4cca8111966cf4f19e16d72eded67 to your computer and use it in GitHub Desktop.
Save fendor/60e4cca8111966cf4f19e16d72eded67 to your computer and use it in GitHub Desktop.
GHC/Foo.hs:6:12: error:
• Overlapping instances for MyEq Bool arising from a use of ‘==’
Matching instances:
instance MyEq Bool -- Defined in ‘GHC.Base’
instance MyEq Bool -- Defined in ‘GHC.Base’
• In the expression: True == True
In an equation for ‘foo’: foo = True == True
module GHC.Base (module GHC.Base, Bool(..)) where
import GHC.Prim
import GHC.Types
default ()
class MyEq a where
(==), (/=) :: a -> a -> Bool
x /= y = not (x == y)
x == y = not (x /= y)
instance MyEq Bool where
False == False = True
True == True = True
_ == _ = False
not :: Bool -> Bool
not True = False
not False = True
inline x = x
module GHC.Foo where
import GHC.Base
foo = True == True
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
clean:
rm -f GHC/*.o
rm -f GHC/*.hi
base01:
rm -f GHC/*.o
rm -f GHC/*.hi
'$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -this-unit-id base -c GHC/Base.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -this-unit-id base --make GHC.Foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment