Last active
February 18, 2020 17:04
-
-
Save pwightman/d6fac395e3e8f4d38cd786a655fb94a6 to your computer and use it in GitHub Desktop.
This file contains 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
# Allows me to call Enum.map as a "pre-curried" func, kind of... | |
[1, 2, 3] | |
|> Enum.map(& &1 * 2) | |
# vs... | |
def my_map(list) do | |
fn transform -> | |
Enum.map(list, transform) | |
end | |
end | |
curried_func = my_map([1, 2, 3]) | |
curried_func.(& &1 *2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment