<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 15, 2019, at 1:04 PM, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" class="">iavor.diatchki@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""><div class="">This is a bit orthogonal, but what would you expect to see in this case:</div><div class=""><br class=""></div><div class="">type T b = Bool</div><div class="">bar :: (a ~ Int) => a -> T b -> a<br class=""></div><div class=""><br class=""></div><div class="">:t bar</div></div></div></div></blockquote><div><br class=""></div><div>Without -fprint-explicit-foralls: (a ~ Int) => a -> T b -> a</div><div>With -fprint-explicit-foralls: forall a b. (a ~ Int) => a -> T b -> a</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">:t bar @Bool</div></div></div></div></blockquote><div><br class=""></div><div>Without -fprint-explicit-foralls: (Bool ~ Int) => Bool -> T b -> Bool</div><div>With -fprint-explicit-foralls: forall b. (Bool ~ Int) => Bool -> T b -> Bool</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I guess the answer to these depends on if `b` is quantified or not.</div></div></div></div></blockquote><div><br class=""></div><div>b *is* quantified -- the quantification happens on the type as the user writes it.</div><div><br class=""></div><div>Richard</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><br class=""></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 15, 2019 at 1:26 AM Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" class="">simonpj@microsoft.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-GB" class="">
<div class="gmail-m_6376247681929278253WordSection1"><p class="MsoNormal" style="margin-left:36pt"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">This looks particularly confusing without the explicit `forall`, although it seems questionable either way.<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span class="">Why?  GHC often suppresses foralls when printing types; and had -fprint-explicit-foralls to stop doing that.<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span class="">Simon<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span class=""><u class=""></u> <u class=""></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt" class="">
<div class="">
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm" class=""><p class="MsoNormal"><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""> ghc-steering-committee <<a href="mailto:ghc-steering-committee-bounces@haskell.org" target="_blank" class="">ghc-steering-committee-bounces@haskell.org</a>>
<b class="">On Behalf Of </b>Richard Eisenberg<br class="">
<b class="">Sent:</b> 14 March 2019 23:46<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@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] #179: Tweak the printing of foralls, recommendation: accept<u class=""></u><u class=""></u></span></p>
</div>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class="">
<blockquote style="margin-top:5pt;margin-bottom:5pt" class="">
<div class=""><p class="MsoNormal">On Mar 14, 2019, at 6:18 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>
<div class="">
<div class="">
<div class="">
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">bar :: forall a b. (a ~ Int) => a -> b -> a<u class=""></u><u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">Is it the case that `:t bar @Bool` will print<u class=""></u><u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">bar :: (Bool ~ Int) => Bool -> b -> Bool<u class=""></u><u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">This looks particularly confusing without the explicit `forall`, although it seems questionable either way.<u class=""></u><u class=""></u></span></p>
</div>
</div>
</div>
</div>
</blockquote>
<div class=""><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
<div class=""><p class="MsoNormal">Yes, you understand correctly. `:t bar @Bool` will print that unfortunate type. I agree this is questionable. But I don't know how to do better. The current state of affairs is awkward in a different way, in that `:t bar @Bool` errors (that's
 OK) and `:t bar @Int` prints `forall {b}. Int -> b -> Int`, even though a further visible type application is possible. Perhaps worse, `:t bar` today prints `forall {b}. Int -> b -> Int` even though the next variable to be instantiated is `a`. This is why
 we have `:type +v`.<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 direction in the proposal came about in wondering if it's possible to improve the mechanics of `:t` (without the `+v`). After we thought of doing maximal instantiation of inferred arguments (but no generalization), then we realized
 we could drop `:type +v` as redundant. I agree it's something of an uneasy compromise here, but I think any choice is going to have unfortunate behavior in some scenarios.<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">Richard<u class=""></u><u class=""></u></p>
</div><p class="MsoNormal"><br class="">
<br class="">
<u class=""></u><u class=""></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt" class="">
<div class="">
<div class="">
<div class="">
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">-Iavor<u class=""></u><u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><u class=""></u> <u class=""></u></span></p>
</div>
</div>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<div class="">
<div class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">On Thu, Mar 14, 2019 at 7:47 AM Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a>> wrote:<u class=""></u><u class=""></u></span></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm" class=""><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">Dear Committee,<br class="">
<br class="">
Richard, in collarboration with Simon PJ, proposes some tweaks to how<br class="">
foralls are printed by GHC.<br class="">
<br class="">
In particular, whenever a type variable is printed with an forall, it<br class="">
is printed with {a} unless it is a specified variable. And there are<br class="">
tweaks to what :type does with its argument that makes it more useful,<br class="">
and obviates the need for a separate :type +v.<br class="">
<a href="https://github.com/goldfirere/ghc-proposals/blob/printing-foralls/proposals/0000-printing-foralls.rst" target="_blank" class="">https://github.com/goldfirere/ghc-proposals/blob/printing-foralls/proposals/0000-printing-foralls.rst</a><br class="">
<br class="">
I like that it actually simplifies the UI (by removing :type +v), so I<br class="">
recommend acceptance.<br class="">
<br class="">
Cheers,<br class="">
Joachim<br class="">
--<span class="gmail-m_6376247681929278253apple-converted-space"> </span><br class="">
Joachim Breitner<br class="">
 <span class="gmail-m_6376247681929278253apple-converted-space"> </span><a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a><br class="">
 <span class="gmail-m_6376247681929278253apple-converted-space"> </span><a href="http://www.joachim-breitner.de/" target="_blank" class="">http://www.joachim-breitner.de/</a><br class="">
<br class="">
-----BEGIN PGP SIGNATURE-----<br class="">
<br class="">
iQIzBAABCAAdFiEEGkYIf5Vdk8V8YFcbPZCKs/D79R8FAlyKaX8ACgkQPZCKs/D7<br class="">
9R/7oxAAgU213SuV+1lr/JExnMSPNWD6s7CPTWdauLK+tHYUv1MD3HeZlBZb2pvN<br class="">
R/swC6jdm95vKXWeMVhfYGFGepOdMEKzqBWLDf3fCO29MlHlb4barwtEZOZ9AbaM<br class="">
DSyE+RjVQ35ATZPvfFTYdBacBrvCivoRWcUdi10ps6rizI86gKeCiG1PN5nVMNV+<br class="">
cpvTpFWRm/xmbtU4xFWuZ9FjL0bfO6yJCueX07gTkdZYW4vnvWSdis6CInkQZ7SA<br class="">
hXbTEYNT9zMCGvJMG+NQN+5c0h3GJlUoTsNGd0PsQnkvoYiLjM52eM5hzkz5zFRr<br class="">
mMYT381T1nnIl505IFGuT/je5KAn7wTImIXvvclwDxfjCBn3J1IRVAbikgwlTU4M<br class="">
9L+tlQiTKI8OZpbgpPjjRj4hWrnX1gzWiIGwtPYtQuPhkDhEvq0xex8qEKpd7waE<br class="">
r5klTYyZrC0LGaHyX5G5yunGLWqnlLKOHAPI20Z1bxVPtDJZ/4g6AoCYSNqBLsHt<br class="">
fMTFflHdKTlsCOETPGhaxgf6PP0WvZtNdgTrB2rL5jzKJSOKc1rVRFAdYIr5PP3H<br class="">
c4aZGce/ChyFazHeF7hH5UZ7yyB0gMc3T+do6I8vySp0YGeRweb36FU13CduMS05<br class="">
rvzb6GIkNFz/Fx2MascE9kZtGvDT9BlxGXqJ9rL/huXquIwN6Gg=<br class="">
=1qbg<br class="">
-----END PGP SIGNATURE-----<br class="">
_______________________________________________<br class="">
ghc-steering-committee mailing list<br class="">
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@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-bin/mailman/listinfo/ghc-steering-committee</a><u class=""></u><u class=""></u></span></p>
</blockquote>
</div><p class="MsoNormal"><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">_______________________________________________<br class="">
ghc-steering-committee mailing list<br class="">
</span><a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class=""><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">ghc-steering-committee@haskell.org</span></a><span style="font-size:9pt;font-family:Helvetica,sans-serif" class=""><br class="">
</span><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" target="_blank" class=""><span style="font-size:9pt;font-family:Helvetica,sans-serif" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</span></a><u class=""></u><u class=""></u></p>
</div>
</blockquote>
</div><p class="MsoNormal"><u class=""></u> <u class=""></u></p>
</div>
</div>
</div>

</blockquote></div>
</div></blockquote></div><br class=""></body></html>