Skip to content

Instantly share code, notes, and snippets.

@jtomchak
Created August 22, 2017 22:44
Show Gist options
  • Save jtomchak/2a6e89f9d31725b61d6bfb8ba9a69ef8 to your computer and use it in GitHub Desktop.
Save jtomchak/2a6e89f9d31725b61d6bfb8ba9a69ef8 to your computer and use it in GitHub Desktop.
All functions in Elm are curried by default. If you have "a function of 2 arguments", it's really a function that takes one argument and returns a function that takes another argument.
fullName fName lName = fName ++ " " ++ lName
//<function> : String -> String -> String
fullName "Jesse"
//<function> : String -> String
lastName = fullName "Jesse"
//<function> : String -> String
lastName "Tomchak"
"Jesse Tomchak" : String
superName fname lname = (String.append fname " ") ++ lname
//<function> : String -> String -> String
superName "Jesse" "Tomchak"
"Jesse Tomchak" : String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment