Last active
May 21, 2016 11:51
-
-
Save nicholasjhenry/d21fdb1f4b7faa537e98a359f7c8af5d to your computer and use it in GitHub Desktop.
Partial application in Elixir
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 Foo do | |
def call(x) do | |
IO.puts x | |
end | |
def bar(x, y) do | |
IO.puts x | |
IO.puts y | |
end | |
end | |
x = &Foo.call/1 | |
x = &(Foo.bar("param 1", &1)) | |
x.("param 2") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment