News for hackers. Stuff that matters.
Re:What is a y-combinator? (2008) by nadaviv on Monday November 11, 2013 @02:58AM (#6710517)
Here's a CoffeeScript fixed-point combinator I wrote some time ago:

  y = ((y)->y y) (y) -> (f) -> (n) -> (f (y y) f) n
Its a little different than the common implementation of y combinator, but looks cooler imo :)

edit: also, a question - a comment on stackoverflow says that fixed-point combinators are used to prove the turing-completeness of lambda calculus. Can't it be proved with something simpler, such as that?

  y = (f) -> (n) -> (f f) n
  fact = y (f) -> (n) -> if n is 0 then 1 else n * (f f) n-1
Re:What is a y-combinator? (2008) by reycharles on Monday November 11, 2013 @06:38AM (#6711090)
You don't need turing completeness to implement the factorial function, hence it is not a proof of turing completeness.