Skip to content

Instantly share code, notes, and snippets.

@vuryleo
Last active December 24, 2015 23:19
Show Gist options
  • Save vuryleo/6878866 to your computer and use it in GitHub Desktop.
Save vuryleo/6878866 to your computer and use it in GitHub Desktop.
Y = (F) ->
((x) ->
F((y) ->
(x(x))(y)))(
(x) ->
F((y) ->
(x(x))(y))
)
FactGen = (fact) ->
(n) ->
if n == 0 then 1 else n * fact(n - 1)
console.info(Y(FactGen)(i)) for i in [1..10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment