[ghc-steering-committee] Proposal: Embrace Type in Type

Joachim Breitner mail at joachim-breitner.de
Mon Apr 16 17:46:14 UTC 2018


Hi,

Am Montag, den 16.04.2018, 11:55 -0400 schrieb Richard Eisenberg:
> An alternative that hasn't been suggested so far is to have
> -XStarIsType control the pretty-printer as well as the parser. Simon
> PJ and I discussed this this morning, thinking it was a good idea.
> Upon further consideration, my preference would be to bite the bullet
> and just switch to printing Type always, but I'm not really against
> the print-*-with-XStarIsType idea.

I’m with Simon here. We have, I believe, precedence where error
messages are affected by the language extension in scope, so this might
satisfy the principle of least surprise, and also cause the least
contention among our users.

We can still apply this rule when `-XNoStarIsType`:

> One slightly separate question is what to print. The proposal
> currently suggests to print Type. There was concern in this thread
> that it would be printed fully-qualified, but I like Joachim's
> suggestion in the last known email in this thread to special-case
> printing of Type; even if it's not imported, it would print as Type,
> not Data.Kind.Type. (Unless some other Type were in scope.) It is
> also easy to teach GHC to print a bespoke warning when a user writes
> Type when it is out of scope, telling them to import Data.Kind.

The proposal currently does not state which modules export Type. I can
infer from the text that it is Data.Kind, but this could be made
explicit. Also, the proposal should state whether it is re-exported
from Prelude or not (I assume it is not).

Cheers,
Joachim

-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20180416/91316910/attachment.sig>


More information about the ghc-steering-committee mailing list