[ghc-steering-committee] Proposal: Top-level kind signatures (#54)

Richard Eisenberg rae at cs.brynmawr.edu
Fri Aug 17 15:33:28 UTC 2018



> On Aug 17, 2018, at 7:24 AM, Simon Peyton Jones via ghc-steering-committee <ghc-steering-committee at haskell.org> wrote:
> 
> Good point.  I was going to say “behave like GADTs” where the variables in the header do not scope over the signatures; but unfortunately in class decls the variables in the header *do* scope over the (term-level) signatures.

It's even worse than this. Not only do they scope over term-level signatures, but they scope over associated type declarations. (Confusingly, they do not scope over associated type family default equations.)

>  
> Richard, what do you think?  Maybe associated types should only be given kind signatures at the top level (alongside the kind signature for the class).  That would at least be clear.

That would be clear and unambiguous, but quite awkward:

class C a where
  type F a b
type F :: ...

Why does one `type` appear in within the class but the other does not? We have some long-winded arguments here to answer that question, but it's all unsatisfying. I don't have a better idea, though.

Separately, we could just tack this new feature into -XKindSignatures instead of inventing a new extension.... but making a change to an extension as stable and as old as -XKindSignatures is unfortunate.

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20180817/e4e3d825/attachment.html>


More information about the ghc-steering-committee mailing list