tag:blogger.com,1999:blog-5411139659011156551.post5506108342341752521..comments2013-03-30T15:53:54.523-07:00Comments on JLOUIS Ramblings: Ripping the backend from Moscow MLJesper Louis Andersenhttps://plus.google.com/108725849902883879959noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5411139659011156551.post-83794038147343948142009-01-21T05:26:00.000-08:002009-01-21T05:26:00.000-08:00Frank:Yes, viewing it through the isomorphism make...Frank:<BR/><BR/>Yes, viewing it through the isomorphism makes the two terms equivalent. If you disallow that, then yes, g will not be able to take tuples. If I remember correctly, Haskell defines &#39;curry&#39; and &#39;uncurry&#39; for transforming between the forms.<BR/><BR/>It is curious: (fn (x,y) =&gt; g x y) (3,4) beta-reduces to &#39;g 3 4&#39;, whereas (fn x y =&gt; f(x,y) 3 beta reduces to (fn y =&gt; f(3,y)). Nothing is gained here, though: &#39;g 3&#39; is really (fn y =&gt; 3 + y). And (fn y =&gt; f(3,y)) can be inlined to (fn y =&gt; 3 + y). At this point, we have the same canonical form, and there is little left to dicuss, save for the need of an inlining.<BR/><BR/>It is first with &#39;h&#39; we get a difference, since &#39;h&#39; does computation between the first and second argument. And that difference is much harder to get by applying an isomorphism. The crucial part here is that I would like to have a fast curry for the LLVM backend because I want people to write their code in a style they prefer.Jlouishttp://www.blogger.com/profile/02990737394952724516noreply@blogger.comtag:blogger.com,1999:blog-5411139659011156551.post-66249642852269343022009-01-20T19:42:00.000-08:002009-01-20T19:42:00.000-08:00g is not more powerful than f, since they are rela...g is not more powerful than f, since they are related by the isomorphism between a * b -&gt; c and a -&gt; b -&gt; c.<BR/><BR/>I can partially apply f to 3: (fn x y =&gt; f(x,y)) 3. If you think that&#39;s cheating, then I submit that f is more powerful than g since g cannot be applied to tuples. Of course, that would be a fib, since I can write (fn (x,y) =&gt; g x y) (3,4). So the situation is symmetric, which is what the isomorphism exhibits.Franknoreply@blogger.com