Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
defmodule SimpleFC do
require Integer
def even(n), do: Integer.is_even(n)
def negate(n), do: not n
def compose(func1, func2) do
fn (n) ->
func2.(func1.(n))
end
end
def not_even(n) do
compose(&even/1, &negate/1).(n)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment