Adding a way to reduce type families in type errors

Jakob Brünker jakob.bruenker at gmail.com
Sun Nov 22 03:38:42 UTC 2020


Hi all,

While there is a way to expand type synonyms in type errors
(-fprint-expanded-synonyms), as far as I know, the same doesn't exist for
type families. For example, the following

type family Foo a where Foo Int = String
type family Bar a :: Maybe (Foo Int) where Bar a = '()

results in the error

Expected kind `Maybe (Foo Int)', but '() has kind `()'

where I'd like to see "Expected kind `Maybe String'".

I'd be interested in trying my hand at implementing a way to see this,
either by adding it to -fprint-expanded-synonyms, or as a new flag.

Three questions:
 - Is there already a way to do this that I'm missing?
 - Are there reasons for why this would be a bad idea?
 - Would a proposal be necessary for this?

Thanks,
Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20201122/88a5229d/attachment.html>


More information about the ghc-devs mailing list