Last active
October 24, 2015 13:54
-
-
Save dgvncsz0f/a51f9c2a0994b07d8f08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Xerpa.Functions do | |
def fix(f) do | |
fn x -> | |
f.(fix(f), x) | |
end | |
end | |
end | |
f = fn loop, x -> | |
if x > 0, do: loop.(IO.inspect(x-1)), else: x | |
end | |
Xerpa.Functions.fix(f).(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment