Created
August 22, 2017 22:44
-
-
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.
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
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