<div dir="ltr">Another tactic, that might be more effective/simpler, is to work out what "primops" you want to use that aren't currently in core.<div>It looks like all the "kappa calclus" operations are expressible in core, so perhaps what you really want are better "markers" that an expression in core might be "kappa calculus like" in some fashion?</div><div><br></div><div>I'm happy to help you suss that out on IRC or the like! </div><div><br></div><div>cheers</div><div>-Carter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 22, 2014 at 6:18 AM, Sophie Taylor <span dir="ltr"><<a href="mailto:sophie@traumapony.org" target="_blank">sophie@traumapony.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Yeah, definitely. Part of the reason why arrow notation is so frustrating at the moment is because it forces everything into lambda calculus; that is, it requires every category to be Cartesian Closed. When your arrow category isn't Cartesian Closed, it raises two issues. 1) When it's not Cartesian, you have to lie and say it supports products instead of tensors (that is, you are able to get back the arguments of a product unchanged, i.e. simple tuples), but this isn't the relevant part for Core. 2) When it's not closed, you have to lie and say it supports higher order functions (i.e., lambda abstractions applied to lambda abstractions) and implement arr. Now, you can lie at the syntax level and typecheck it as kappa calculus (i.e. first order functions only unless you are explicitly a Closed category) but then say it is lambda calculus at the core level; this would work because lambda calculus subsumes kappa calculus. This would allow the optimiser/RULES etc to work unchanged. However, you would lose a lot of the internal consistency checking usefulness of Core, and could miss out on kappa-calculus-specific optimisations (although come to think of it, call arity analysis might solve a lot of this issue).</span><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 22 October 2014 19:59, Simon Peyton Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br><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">
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Interesting.  There is a pretty high bar for changes to Core itself.  Currently arrow notation desugars into Core with no changes.  If you want to change Core,
 then arrow “notation” is actually much more than syntactic sugar.   Go for it – but it would be a much more foundational change than previously, and hence would require more motivation.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">S<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Sophie Taylor [mailto:<a href="mailto:sophie@traumapony.org" target="_blank">sophie@traumapony.org</a>]
<br>
<b>Sent:</b> 22 October 2014 10:53<br>
<b>To:</b> Simon Peyton Jones<br>
<b>Cc:</b> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Re: Current description of Core?<u></u><u></u></span></p>
</div>
</div><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Ah, thanks HEAPS. I've been banging my head against a wall for the last few days trying to see exactly what is going on :) I'm trying to find a way to minimise/eliminate the changes required to Core for the arrow notation rewrite  - specifically, introducing
 kappa abstraction and application - semantically different to lambda abstraction/application but close enough that I can probably get away with either adding a simple flag to the Abstraction/Application constructors or doing it higher up in the HsExpr land,
 but the latter method leaves a sour taste in my mouth.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On 22 October 2014 19:35, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt;margin-left:36.0pt">
Is the current description of Core still System FC_2 (described in <a href="https://www.seas.upenn.edu/~sweirich/papers/popl163af-weirich.pdf" target="_blank">
https://www.seas.upenn.edu/~sweirich/papers/popl163af-weirich.pdf</a>)?<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">We never implemented that particular version (too complicated!).</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">This is the full current story (thanks to Richard for keeping it up to date), in the GHC source tree</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">:</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""><a href="https://ghc.haskell.org/trac/ghc/browser/ghc/docs/core-spec/core-spec.pdf" target="_blank">https://ghc.haskell.org/trac/ghc/browser/ghc/docs/core-spec/core-spec.pdf</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">
 ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@haskell.org</a>]
<b>On Behalf Of </b>Sophie Taylor<br>
<b>Sent:</b> 22 October 2014 10:26<br>
<b>To:</b> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Current description of Core?</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt">Is the current description of Core still System FC_2 (described in
<a href="https://www.seas.upenn.edu/~sweirich/papers/popl163af-weirich.pdf" target="_blank">
https://www.seas.upenn.edu/~sweirich/papers/popl163af-weirich.pdf</a>)?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:6.0pt"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>