[Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread Heinrich Apfelmus
Eugene Kirpichov wrote: > I took a toy problem - find the first node satisfying a predicate in a > binary tree, started with a naive Maybe-based implementation - and > experimented with 3 ways of changing the program: > - Church-encode the Maybe > - Convert the program into CPS > - Defunctionali

[Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread Heinrich Apfelmus
David Menendez wrote: > On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus > wrote: >> Even then, the results are mixed. The Church-encoding shines in GHCi as >> it should, but loses its advantage when the code is being compiled. I >> guess we have to look at the core if we want to know what exactl

[Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-02 Thread Heinrich Apfelmus
David Menendez wrote: > Heinrich Apfelmus wrote: >> David Menendez wrote: >>> Heinrich Apfelmus wrote: Even then, the results are mixed. The Church-encoding shines in GHCi as it should, but loses its advantage when the code is being compiled. I guess we have to look at the core if we

Re: [Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus wrote: > Even then, the results are mixed. The Church-encoding shines in GHCi as > it should, but loses its advantage when the code is being compiled. I > guess we have to look at the core if we want to know what exactly is > going on. What optimi

Re: [Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 12:31 PM, Heinrich Apfelmus wrote: > David Menendez wrote: >> On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus >> wrote: >>> Even then, the results are mixed. The Church-encoding shines in GHCi as >>> it should, but loses its advantage when the code is being compiled. I >>