Skip to content

Preserve user-written types in data declarations

sheaf requested to merge sheaf/ghc:T26246 into master

Work in progress on #26246.

In this MR, I am trying to do the following two things:

  1. When kind-checking a TyCon, avoid expanding type synonyms. For example, with type T2T = Type -> Type; type S :: T2T; data S a where {..}, I want tyConKind to be T2T and not Type -> Type.
  2. When storing DataCons in interface files, keep the user-written binders; for example in data G a b where { D :: G x y }, I want the type of D to be forall x y. G x y and not forall a b. G a b.

The main motivation for these changes is Haddock, which gets its information from interface files. However, (1) also improves the :kind output in GHC as it no longer expands type synonyms.

Edited by sheaf

Merge request reports

Loading