3 ms·
@platz, yes, this is correct. When currying and/or composing functions, it becomes more difficult to determine the input/output types of the function since the
by lrichardson 12y ago
@platz, yes, this is correct. When currying and/or composing functions, it becomes more difficult to determine the input/output types of the function since the function signature won't be right there. I'm borrowing the `//+` syntax from Brian Lansdorf, since I saw him use it and quite like it. He mentioned he has "a lot to say on the topic" of commenting / type sigs, but I haven't heard him speak specifically on that.
Also, for functions that do different things depending on how many arguments are passed in, you would never want to curry these. The curry function relies on the function passed in expecting a specific number of arguments.
- platz 12y agoPart of me thinks that if you're going to pursue this style to it's extreme, you might as well just be better off using something like purescript http://purescript.readthedocs.org/en/latest/intro.html#hello-purescript http://purescript.readthedocs.org/en/latest/intro.html#hello...
- lrichardson 12y agoI haven't had a chance to try purescript yet, but I have looked at it. Really though, I love JavaScript, and don't have much desire to use another language that that transpiles into it...
- platz 12y agoFair enough, there's always headaches with transpilers; I for one have been suspicious of all the coffeescript+derivatives.