<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Kind signatures may not be the first thing students see, but they pop up pretty quickly, basically when you explain the difference between a manifest type and a type constructor. They also often are part of error messages, even if you don’t do fancy type-level programming and probably don’t import ’Type’ explicitly.<div class=""><br class=""></div><div class="">I also think, Haskell is beyond the point where our only worry wrt to textbooks is 101 type material.</div><div class=""><br class=""></div><div class="">So, I think, we need a convenient and concise notation that doesn’t require extra imports.</div><div class=""><br class=""></div><div class="">Manuel<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">11.02.2018 15:05 Ryan Newton <<a href="mailto:rrnewton@indiana.edu" class="">rrnewton@indiana.edu</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">@Manuel, for you would it be sufficient for *-deprecation to have an <i class="">eventual</i> plan to put Type prelude?<div class=""><br class=""></div><div class="">I just can't see how, if Haskell were designed today, the "*" convention would come to be. Personally, I worry more about legacy/textbook issues for topics that are a bit closer to CS101 than I believe kind signatures are.</div><div class=""><br class=""></div><div class=""> -Ryan</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Feb 10, 2018 at 12:42 AM, Manuel M T Chakravarty <span dir="ltr" class=""><<a href="mailto:chak@justtesting.org" target="_blank" class="">chak@justtesting.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class="">Yes, that’s why I think, we cannot deprecate it until we have an alternative that is not the fully qualified name.<span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span><div class=""><span class="HOEnZb"><font color="#888888" class="">Manuel</font></span><div class=""><div class="h5"><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">Am 10.02.2018 um 04:46 schrieb Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" target="_blank" class="">iavor.diatchki@gmail.com</a>>:</div><br class="m_7723283638798158272Apple-interchange-newline"><div class=""><div dir="ltr" class="">The issue I see is that it is quite common to get a kind error without doing any fancy type level programming---in particular without writing kind signatures or anything like that. So you'd have no reason to import `Data.Kind(Type)`. The result would be that GHC would give quite a verbose error message, using the fully qualified name of `Type`. Unless we did something special.<div class=""><div class=""><br class=""></div><div class="">-Iavor</div><div class=""><br class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Feb 9, 2018 at 2:41 AM Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank" class="">simonpj@microsoft.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple" class="">
<div class="m_7723283638798158272m_7067417807362020023WordSection1"><p class="MsoNormal"><span style="font-size:12.0pt" class="">I’m not sure I see the problem here. If ‘Int’ is not in scope then<u class=""></u><u class=""></u></span></p><p class="MsoNormal" style="text-indent:5.25pt"><span style="font-size:12.0pt" class="">f :: Int -> Int<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt" class="">won’t work. What’s different about ‘Type’<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt" class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt" class="">Simon<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt" class=""><u class=""></u> <u class=""></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class="">
<div class="">
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm" class=""><p class="MsoNormal"><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""> ghc-steering-committee [mailto:<a href="mailto:ghc-steering-committee-bounces@haskell.org" target="_blank" class="">ghc-steering-<wbr class="">committee-bounces@haskell.org</a>]
<b class="">On Behalf Of </b>Richard Eisenberg<br class="">
<b class="">Sent:</b> 09 February 2018 04:26<br class="">
<b class="">To:</b> Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" target="_blank" class="">iavor.diatchki@gmail.com</a>><br class="">
<b class="">Cc:</b> <a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@<wbr class="">haskell.org</a>; Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a>><br class="">
<b class="">Subject:</b> Re: [ghc-steering-committee] Proposal: Embrace Type in Type<u class=""></u><u class=""></u></span></p>
</div>
</div></div></div></div><div lang="EN-GB" link="blue" vlink="purple" class=""><div class="m_7723283638798158272m_7067417807362020023WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt" class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p><p class="MsoNormal">Thanks, Iavor, for bringing this up.<u class=""></u><u class=""></u></p>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">To clarify the proposal: -XStarIsType is orthogonal to deprecation. The extension is necessary in order to continue to parse existing programs, but if we choose to deprecate *, then we would deprecate even with -XStarIsType is enabled (precisely
to avoid the half-deprecation scenario Iavor is worried about).<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">I envisioned always printing Type unqualified in error messages, even if it's not imported. If a user writes Type and it's out of scope, we could always have a special-case check suggesting they import Data.Kind. I won't argue this is a
principled design, though, and is likely a poor choice if some other Type is in scope.<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">The truth is that I don't have a great way forward here (and haven't for years) and am very hopeful someone on this list can come up with one! :) The proposal has my best idea, but I'm still not thrilled with it.<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">Thanks,<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">Richard<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class="">
<div class="">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" class="">
<div class=""><p class="MsoNormal">On Feb 8, 2018, at 1:46 PM, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" target="_blank" class="">iavor.diatchki@gmail.com</a>> wrote:<u class=""></u><u class=""></u></p>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class="">
<div class="">
<div class=""><p class="MsoNormal">Hello,<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">I didn't see any discussion about the third part of this proposal, namely the addition of a new extension called `StarIsKind`. The idea is that when this is on, `*` will still be treated as a special alpha-numeric name, and it will *always*
refer to the kind of inhabited types (i.e., same as know). The difference is that it cannot be used as another type-level operator (e.g., for multiplication).<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">Presumably, when this extension is on, there would be no deprecation warning emitted for `*`? We should clarify this in the proposal.<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">I am not certain if this is a good idea. It makes the use of `*` sort of "half" deprecated, and leaves us with multiple "standard" ways to refer to the same thing (e.g., in type errors). Also, if we want people to update their code to
use `Type` instead of `*`, then we are just delaying the pain point to whenever `StarIsKind` ends up being not on by default.<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">OTOH, if we don't have a standard short-hand way to refer to the kind of inhabited types, I imagine GHC will report some very ugly errors. For example:<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class=""><p class="MsoNormal"> • Expecting one more argument to ‘Maybe’<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"> Expected a type, but ‘Maybe’ has kind ‘Data.Kind.Type -> Data.Kind.Type’<u class=""></u><u class=""></u></p>
</div>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">And this is for a fairly simple kind error, they get much longer if, say, monad transformers are involved.<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">What do others think?<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">-Iavor<u class=""></u><u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class="">
<div class=""><p class="MsoNormal">On Sat, Feb 3, 2018 at 8:24 PM Richard Eisenberg <<a href="mailto:rae@cs.brynmawr.edu" target="_blank" class="">rae@cs.brynmawr.edu</a>> wrote:<u class=""></u><u class=""></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm" class=""><p class="MsoNormal"><br class="">
> On Feb 1, 2018, at 8:58 PM, Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a>> wrote:<br class="">
><br class="">
> In particular in light of our use of “type” as a explicit namespace<br class="">
> token – so far in export and import lists and fixity declarations – I<br class="">
> worry that we will prevent ourselves from using more such explicit<br class="">
> namespace things in the future.<br class="">
<br class="">
This is a really good point. In private musings, I've often wondered about using the keyword `type` in expressions to denote a namespace change. More concretely, I'm worried about the Dreaded Namespace Problem (DNP): that is, a dependently typed language does
not want to have separate type-level and term-level namespaces. Of course, Haskell has this.<br class="">
<br class="">
The best solution I have so far to the DNP is to introduce a *new* namespace, distinct from the two namespaces we have so far. Let's call it the "default" namespace. When -XDependentTypes is on, the default namespace is in effect. Name lookup looks first in
the default namespace. If that fails the namespace consulted next depends on context: the "data" namespace in terms and the "type" namespace in type signatures. (This last bit needs to be specified more concretely, but you get the idea.) Or, perhaps, a failed
lookup in the default namespace will look up in both the type and data namespaces, erroring if a name appears in both.<br class="">
<br class="">
If a user wants to specify a namespace directly, they have a very easy way to do so: `type Foo` will look in the type namespace, `data Foo` will look in the data namespace, and `default Foo` will look in the default namespace. :) Because these keywords make
sense currently only at the beginning of a line, this Just Works. I also imagined these constructs could scope over a subexpression: `type (T S)`.<br class="">
<br class="">
All of this deserves a proper proposal and it's too early for that proposal. Nevertheless, I'm grateful that Joachim said something here, given that adding `type` as a spelling of `Type` would invalidate this approach. I also am swayed by the fact that `Type`
isn't fully primitive, and making a keyword mean something that's not primitive is a bit awkward. I thus retract this proposed alternative and will update the proposal accordingly.<br class="">
<br class="">
Richard<br class="">
______________________________<wbr class="">_________________<br class="">
ghc-steering-committee mailing list<br class="">
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@<wbr class="">haskell.org</a><br class="">
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" target="_blank" class="">https://mail.haskell.org/cgi-<wbr class="">bin/mailman/listinfo/ghc-<wbr class="">steering-committee</a><u class=""></u><u class=""></u></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
</div></div></div></blockquote></div></div></div></div></div>
______________________________<wbr class="">_________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@<wbr class="">haskell.org</a><br class=""><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" target="_blank" class="">https://mail.haskell.org/cgi-<wbr class="">bin/mailman/listinfo/ghc-<wbr class="">steering-committee</a><br class=""></div></blockquote></div><br class=""></div></div></div></div><br class="">______________________________<wbr class="">_________________<br class="">
ghc-steering-committee mailing list<br class="">
<a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@<wbr class="">haskell.org</a><br class="">
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank" class="">https://mail.haskell.org/cgi-<wbr class="">bin/mailman/listinfo/ghc-<wbr class="">steering-committee</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>