Created
January 19, 2019 23:22
-
-
Save Tombarr/e7a51f2c7ba79b57e9040485785a7c09 to your computer and use it in GitHub Desktop.
Functions as arguments 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
add_ten = fn (x) -> x + 10 end | |
do_a_thing_to_x = fn (thing, x) -> | |
thing.(x) | |
end | |
do_a_thing_to_x.(add_ten, 10) # 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment