I understand that in haskell if we make a data type deriving Ord it should be deriving Eq as well, but why do we have to explicitly write both of them in the definition?
One could plausibly derive Ord but instantiate Eq by hand:
data Foo = Foo deriving Ord
instance Eq Foo where
_ == _ = True
I can't think of a place off-hand where this would be useful, but there's no reason to prevent it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With