Skip to main content
1 of 2
amindfv
  • 8.4k
  • 6
  • 38
  • 58

You can't hide instances from an imported module. See for example: Explicitly import instances

It looks like the "overloading" you're trying to do is to allow (==) for other types, like trees. This is easy! Just simply create a new instance:

data Tree a = Leaf a | Branch [Tree a] instance (Eq a) => Eq (Tree a) where (Leaf a) == (Leaf b) = a == b (Branch a) == (Branch b) = a == b _ == _ = False 

(You could also just derive the Eq instance)

amindfv
  • 8.4k
  • 6
  • 38
  • 58