Skip to content

GHC-83865 is (too?) generic of an error code

Motivation

GHC-83865, "TypeEqMismatch", seems to cover many errors that could perhaps be given more specific, individual codes.

It covers situations where:

  1. A type is expected, but a kind is given ("Expected a type, but ‘Maybe’ has kind ‘* -> *’")
  2. Type a is expected, but type b is given ("Couldn't match expected type ‘Int’ with actual type ‘Char’")
  3. Levity mismatch ("Couldn't match a lifted type with an unlifted type")
  4. Kind a is expected, but kind b is given ("Expected kind ‘* -> k3’, but ‘Type’ has kind ‘*’")
  5. SimplifiedSubsumption breaks code ("Couldn't match type ‘()’ with ‘forall t. t’")
  6. A special case of (2) that adds the message, "The function ‘t2’ is applied to one value argument, but its type ‘Int’ has none"

I can recognize how these are all examples of "the same thing", but in practice they cover a lot of ground and would make an entry in https://errors.haskell.org pretty unwieldy.

Proposal

I don't have a concrete proposal, as someone unfamiliar with the specifics of errors. I am hoping someone can help choose between these outcomes:

  1. Bite the bullet and write a dissertation for the errors.haskell.org entry
  2. Create new codes to represent the most pertinent distinct situations
  3. Somehow improve the message when SimplifiedSubsumption is suspected
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information