Add kind signatures to tyvars with kind not 'Type'#915
Add kind signatures to tyvars with kind not 'Type'#915sjakobi merged 2 commits intohaskell:wip/hi-haddockfrom
Conversation
This means that the kinds do not get completely swallowed up in
signatures where they matter, like
foo :: forall proxy (a :: ()). proxy a
It also means that _all_ higher-kinded type variables now have
explicit kinds.
The idea is to hide kind signatures for type variables where the kind can be inferred from at least one use of the type variable in the given type. This seems to strike a nice balance between maintaining existing behaviour and showing something that isn't incorrect.
|
I've come up with what I think is a decent heuristic for hiding some kind signatures and foralls. In particular, we drop kind signatures for type variables when
For example, consider the type variable
Finally, if all of the type variables in a type end up not needing kind signatures (and the order in which the type variables are mentioned matches the order of the explicit foralls), we drop the whole Working on ScreenshotsFor the |

This means that the kinds do not get completely swallowed up in
signatures where they matter, for instance in
It also means that all higher-kinded type variables now have
explicit kinds.
/cc @sjakobi
I don't think this is what we ultimately want, but we definitely want at least some of these kind annotations. I'm open to implementing any ideas people may have for constraining the number of annotations we show.
The
FunArgstest is what initially motivated me to make these changes:On

ghc-head:On

wip/hi-haddock:On this branch:
