[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 want to know

[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 - Defunctionalize

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 apfel...@quantentunnel.de 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

[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 apfel...@quantentunnel.de 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

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 apfel...@quantentunnel.de wrote: David Menendez wrote: On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Even then, the results are mixed. The Church-encoding shines in GHCi as it should, but loses its