3 ms·
I never understood why the function signatures/types in functional languages were written like this: func: arg1 -> arg2 -> arg3 -> result But after I used
by k__ 10y ago
I never understood why the function signatures/types in functional languages were written like this:
func: arg1 -> arg2 -> arg3 -> result
But after I used LiveScript and then ES2015 it finally clicked. In many functional languages, every function is "automatically" curried or to say it differently, every function only takes one argument and you have to "implement" you multi-argument-function with closures, which leads to curried functions in the end.
But languages like LiveScript are a bit nicer to use in that regard, because they don't require () to call them. This leads to curried function-calls looking different from normal ones in JavaScript.