Skip to content

be a bit more helpful when it comes to distinguishing different type-level constructs

Summary

Often I get type errors like this:

"No instance Foo (Bar Baz)" or "No instance Foo (Bar Baz [..] a0)"; this happens because type families didn't reduce; not because there's really not an instance; I would like to have the following aid of the type checker:

  • if there's a some type family, that didn't reduce, leave an NB, that Bar is indeed a type family and that it didn't reduce or, even better, tell the user
    1. how they instantiated the type family
    2. that there is no equation for this instantiation

This is helpful for two reasons:

  1. identify what kind of type level constructs you're using; in more involved projects, you sometimes have a hard time knowing what is a type synonym/ type family/ class/ data type
  2. identify when there might be an instance but your instantiation is wrong/ you're missing an instance/ your types didn't monomorphize enough
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information