Y-combinator in Erlang

Hakan Millroth <>
Wed Jan 8 15:18:27 CET 2003

>   Now  how the  average  Håkan might  have  written it  is a  entirely
> different matter :-)

As a named function. Whatever you gain in expressive power with funs 
you risk losing by people using them in a way that is hard to 

Classic example. Consider the higher-order function (standard math 

twice(F)(X) = F(F(X))

Let double(X)=X+X and figure out what F(1) is, where 

I'm just arguing that sometimes power tools are not good things.

-- Hakan

More information about the erlang-questions mailing list