Skip to content

Can't derive instance for Eq when datatype has no constructor, while it is trivial do do so.

On a "phantom datatype" D, one gets the message:

Can't make a derived instance of `Eq D':
      `D' must have at least one data constructor

However there is a trivial, correct instance of Eq D:

instance Eq D where
  (==) = undefined
Edited by Ömer Sinan Ağacan
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information