<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 23, 2016, at 8:59 AM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">Richard<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">I have just spent an hour plumbing the torrid swamp of binder visibility. There is bad naming confusion.<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">We have<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Visible<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Specified<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Invisible<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">The function isVisible returns True for Visible and False otherwise. But isInvisible returns True for Invisible<span class="Apple-converted-space"> </span><b>and Specified</b>. And partitionInvisibles, filterOutInvisibleTyVars, filterOutInvisibleTypes etc all treat Invisible and Specified the same. That is, it’s really filterOutInvisibleOrSpecifiedTypes which is terribly clumsy.</span></p></div></div></blockquote><div><br></div><div>Here is another design I considered:</div><div><br></div><div>> data VisibilityFlag</div><div>> = Visible</div><div>> | Invisible SpecifiedFlag</div><div>></div><div>> data SpecifiedFlag = Specified | Inferred</div><div><br></div><div>That might make this all a bit clearer. I avoided this extra layer of indirection, though, as overly ornate. Perhaps I was wrong.</div><div><br></div><div>isVisible and isInvisible (the functions) are indeed opposites of each other. That's good, in my book. But it is confusing that Specified is lumped in with Invisible here.</div><br><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; "><o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; "> </span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">Sometimes we need to pick up just the Inivisble args, and we don’t have a predicate for that (since isInvisible is taken), so you’ll see in Inst.top_instantiate we are reduced to saying (binderVisibility bndr == Invisible).<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">It’s all very smelly. The trouble is that<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">In displayed types like (T a b), we display args that are Visible, but not Specified or Invisible</span></p></div></div></blockquote><div><br></div><div>True.</div><br><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; "><o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">In visible type application like (f @t1 @t2) we can specify type args that are Visible or Specified but not Invisible.</span></p></div></div></blockquote><div><br></div><div>No. We can't use visible type application with Visible arguments. If they're Visible, then you don't need the @.</div><br><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; "><o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; "> </span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">Urgh. The trouble is that “invisible” is not the negation of “visible”, which leads to all kinds of confusion.<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">I wonder about changing to<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Explicit<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Specified<o:p></o:p></span></p><p class="MsoListParagraph" style="margin: 6pt 0cm 6pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt; "><span style="font-size: 12pt; font-family: Symbol; "><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; "> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 12pt; ">Implicit<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">Then for display we display Explicit args only; for VTA we can specify Explicit or Specified args.<o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">So “not Explicit” doesn’t sound structurally like “Implicit” in the way that “not Visible” does sound like “Invisible”.</span></p></div></div></blockquote><div><br></div><div>I don't see the improvement here. "Invisible" and "visible" are antonyms, just like "implicit" and "explicit". Yes, it's true that "implicit" isn't just a prefix put on "explicit", but I hardly think that matters.</div><div><br></div><div>How about</div><div> * Required</div><div> * Specified</div><div> * Inferred</div><div><br></div><div>A Required argument is just that: it must be provided at all call sites. A Specified argument is one whose order we know about and can be given by visible type application. An Inferred argument is invented by GHC and cannot be affected by the user. With this phrasing, no word is an antonym of another.</div><div><br></div><div>Richard</div><br><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; "><o:p></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 12pt; ">Simon<o:p></o:p></span></p></div></div></blockquote></div><br></body></html>