Skip to content

Instantly share code, notes, and snippets.

@dgvncsz0f
Last active October 24, 2015 13:54
Show Gist options
  • Save dgvncsz0f/a51f9c2a0994b07d8f08 to your computer and use it in GitHub Desktop.
Save dgvncsz0f/a51f9c2a0994b07d8f08 to your computer and use it in GitHub Desktop.
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