Skip to content

Fix kind inference for data types. Again.

Simon Peyton Jones requested to merge wip/T18891 into master

This patch improves kcConDecls, when we are inferring the kind of a data type decl.

Specifically

  • In kcConDecls/kcConDecl make it clear that the tc_res_kind argument is only used in the H98 case; and in that case there is not result kind signature; and hence no need for the disgusting splitPiTys in kcConDecls (now thankfully gone).

    The GADT case is a bit different to before, and much nicer. This is what fixes #18891 (closed).

    See Note [kcConDecls: kind-checking data type decls]

  • Do not look at the constructor decls of a data/newtype instance in tcDataFamInstanceHeader. See new Note [Kind inference for data family instances]

    This causes a few knock-on effects in the tests suite, because we require more information than before in the instance /header/.

    New user-manual material about this in "Kind inference in data type declarations" and "Kind inference for data/newtype instance declarations".

  • Minor improvement in kcTyClDecl, combining GADT and H98 case.

  • Further fixes to kind checking type decls. In particular, fix #14111 (closed) and #8707 (closed)

Fixes #18891 (closed)

Edited by Simon Peyton Jones

Merge request reports