<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 31, 2017, at 5:41 PM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" class="">simonpj@microsoft.com</a>> wrote:</div><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">But that can only happen if `(->)` has suitable roles.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">What if it doesn’t?</span></div></div></div></blockquote><div><br class=""></div><div>The “correct” roles for (->) of the kind you gave is `nominal nominal nominal nominal representational representational`. That is, the dependent arguments are nominal, and the others are representational. This is because all kind-level coercions are nominal. You seem to be suggesting giving (->) different roles. I honestly don’t know what that would mean -- normally, GHC prevents you from specifying a weaker role than it would infer. It smells pretty foul to me, but I can’t quite put my finger on what would go wrong at the moment.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">What if we just had an axiom<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class="">axArrow v ::    (->) Vanilla    v<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class="">             ~R (->) Constraint v</span></div></div></div></blockquote><div><br class=""></div><div>I think we’d also need one for results... but maybe not.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">or something like that.   Then we get<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class="">[W] g :    (->) Vanilla    Vanilla Ptr Ptr (C a) Int<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class="">        ~R (->) Constraint Vanilla Ptr Ptr a     Int<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">We decompose partly and solve thus<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class="">g = (axArrow Vanilla) <Ptr> <Ptr> axC <Int></span></div></div></div></blockquote><div><br class=""></div><div>And this works only if we weaken (->)’s roles.</div><div><br class=""></div><div>This whole road just feels like the wrong way, as soon as we started contemplating a heterogeneous axiom, which are ruled out in the literature, even when we have kind equalities.</div><div><br class=""></div><div>I think the Right Answer is to get rid of newtype-classes & fix reify, and I’m worried that anything short of that will fail catastrophically at some point. Otherwise, it’s patches on top of patches.</div><div><br class=""></div><div>I don’t think there is disagreement here, but there is the question about what to do for 8.2.... and unless we’re ready to roll out the new reify, I think the best course of action is to delay the new Typeable and all this Constraint v Type stuff until 8.4. (The new levity polymorphism stuff already committed is hunky-dory.)</div><div><br class=""></div><div>Richard</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 10pt; font-family: 'Courier New';" class=""><span class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">Simon<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="_MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></a></div><span class=""></span><div style="border-style: none none none solid; border-left-color: blue; border-left-width: 1.5pt; padding: 0cm 0cm 0cm 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:noreply@phabricator.haskell.org" style="color: purple; text-decoration: underline;" class="">noreply@phabricator.haskell.org</a><span class="Apple-converted-space"> </span>[<a href="mailto:noreply@phabricator.haskell.org" style="color: purple; text-decoration: underline;" class="">mailto:noreply@phabricator.haskell.org</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>31 January 2017 12:51<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" style="color: purple; text-decoration: underline;" class="">simonpj@microsoft.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[Differential] [Commented On] D2038: [WIP] TysPrim: Generalize kind of (->)<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif;">goldfire added a comment.<span class="Apple-converted-space"> </span><o:p class=""></o:p></p><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a href="https://phabricator.haskell.org/D2038" style="color: purple; text-decoration: underline;" class=""><b class=""><span style="color: rgb(70, 76, 92); background-color: rgb(247, 247, 249); text-decoration: none; background-position: initial initial; background-repeat: initial initial;" class="">View Revision</span></b></a><o:p class=""></o:p></div></td></tr></tbody></table><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></p><div class=""><div class=""><blockquote style="border-style: none none none solid; border-left-color: rgb(140, 152, 184); border-left-width: 2.25pt; padding: 0cm 0cm 0cm 9pt; margin: 3pt 0cm 9pt;" class=""><div class=""><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(248, 249, 252); background-position: initial initial; background-repeat: initial initial;"><span style="font-size: 10pt; font-family: Calibri, sans-serif; color: rgb(107, 116, 140);" class="">In<span class="Apple-converted-space"> </span><a href="https://phabricator.haskell.org/D2038#89360" style="color: purple; text-decoration: underline;" class=""><b class=""><span style="border: 1pt none windowtext; padding: 0cm; background-color: rgb(231, 231, 231); text-decoration: none;" class="">D2038#89360</span></b></a>,<span class="Apple-converted-space"> </span><a href="https://phabricator.haskell.org/p/simonpj/" style="color: purple; text-decoration: underline;" class=""><b class=""><span style="color: rgb(25, 85, 141); border: 1pt none windowtext; padding: 0cm; background-color: rgb(241, 247, 255); background-position: initial initial; background-repeat: initial initial;" class="">@simonpj</span></b></a><span class="Apple-converted-space"> </span>wrote:<o:p class=""></o:p></span></p></div><div class=""><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: rgb(248, 249, 252); background-position: initial initial; background-repeat: initial initial;" class=""><i class=""><span style="color: rgb(107, 116, 140);" class="">To avoid being able to extract<span class="Apple-converted-space"> </span></span></i><tt style="font-family: 'Courier New';" class=""><i class=""><span style="font-size: 10pt; color: rgb(107, 116, 140); background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">ContraintRep ~R LiftedPtrRep</span></i></tt><i class=""><span style="color: rgb(107, 116, 140);" class=""><span class="Apple-converted-space"> </span>we decided to weaken one of the coercion constructors, the one that gets a kind coercion from a type coercion. We don't need it, and it's awkward here.<o:p class=""></o:p></span></i></p></div></blockquote><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">The problem is that we need it with this patch. I was able to weaken this coercion constructor (<tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">KindCo</span></tt>) in my patch<a href="https://phabricator.haskell.org/D3023" style="color: purple; text-decoration: underline;" class=""><b class=""><span style="border: 1pt none windowtext; padding: 0cm; background-color: rgb(231, 231, 231); text-decoration: none;" class="">D3023</span></b></a>, but this patch uses it in a fundamental way that we can't get around. To wit:<o:p class=""></o:p></p><div style="margin-top: 9pt; margin-bottom: 9pt;" class=""><pre style="margin: 0cm 0cm 0.0001pt; font-size: 10pt; font-family: 'Courier New'; line-height: 11.25pt;" class=""><span style="font-size: 8.5pt; font-family: Consolas;" class="">class C a where<o:p class=""></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 10pt; font-family: 'Courier New'; line-height: 11.25pt;" class=""><span style="font-size: 8.5pt; font-family: Consolas;" class="">  meth :: a<o:p class=""></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 10pt; font-family: 'Courier New'; line-height: 11.25pt;" class=""><span style="font-size: 8.5pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 10pt; font-family: 'Courier New'; line-height: 11.25pt;" class=""><span style="font-size: 8.5pt; font-family: Consolas;" class="">axC :: (C a :: Constraint) ~R (a :: Type)<o:p class=""></o:p></span></pre></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Now, we wish to cast<span class="Apple-converted-space"> </span><tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">C a -> a</span></tt><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">a -> a.</span></tt>. This cast will look like<span class="Apple-converted-space"> </span><tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">(->) ?? <LiftedRep> axC <a></span></tt>. What goes in the<tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">??</span></tt>? It's got to be something involving<span class="Apple-converted-space"> </span><tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">KindCo axC</span></tt>, which is disallowed as per our earlier decision. Therein lies the problem.<o:p class=""></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">As for<span class="Apple-converted-space"> </span><tt style="font-family: 'Courier New';" class=""><span style="font-size: 10pt; background-color: rgb(235, 235, 235); background-position: initial initial; background-repeat: initial initial;" class="">reify</span></tt>: Yes, I'm agreed with that email. But is that implemented yet? Is a design settled on? I don't see a ghc-proposal. Are we wiling to take a dependency on that work in order to get this done?<o:p class=""></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">To be clear, my chief worry isn't that these problems cannot be solved by any means -- I'm just worried about the timing of this all and our desire to get 8.2 out the door.<o:p class=""></o:p></p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><strong class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">REPOSITORY</span></strong><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">rGHC Glasgow Haskell Compiler<o:p class=""></o:p></span></div></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><strong class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">REVISION DETAIL</span></strong><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><a href="https://phabricator.haskell.org/D2038" style="color: purple; text-decoration: underline;" class="">https://phabricator.haskell.org/D2038</a><o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><strong class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">EMAIL PREFERENCES</span></strong><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><a href="https://phabricator.haskell.org/settings/panel/emailpreferences/" style="color: purple; text-decoration: underline;" class="">https://phabricator.haskell.org/settings/panel/emailpreferences/</a><o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><strong class=""><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">To:<span class="Apple-converted-space"> </span></span></strong><span style="font-size: 10pt; font-family: Calibri, sans-serif;" class="">bgamari, goldfire, austin<br class=""><strong class=""><span style="font-family: Calibri, sans-serif;" class="">Cc:<span class="Apple-converted-space"> </span></span></strong>simonpj, RyanGlScott, thomie</span></div></div></div></div></div></blockquote></div><br class=""></body></html>