3 ms·
Some of these points are true of currying in general -- IMO most of the time you can't tell what's a function call and what's a curry (Haskell people would say
by tolmasky 9y ago
Some of these points are true of currying in general -- IMO most of the time you can't tell what's a function call and what's a curry (Haskell people would say "its the same thing!"). However, separating these concepts leads to a lot of super interesting results. I wrote about this in this blog post: http://tolmasky.com/2016/03/24/generalizing-jsx/ http://tolmasky.com/2016/03/24/generalizing-jsx/ . I argue that the JSX syntax makes for an awesome syntax for currying.
Edit: Some follow up articles:
1. Using this scheme, you can actually have default parameters in currying: https://runkit.com/tolmasky/default-parameters-with-generic-jsx https://runkit.com/tolmasky/default-parameters-with-generic-...
2. An example of how to apply this to Babel syntax trees: http://runkit.com/tolmasky/generic-jsx-for-babel-javascript-ast http://runkit.com/tolmasky/generic-jsx-for-babel-javascript-...
- aidenn0 9y agoThanks for resharing that post; I found it more engrossing than the original article!
- deleted 9y ago[deleted]
- gizmo686 9y ago>Haskell people would say "its the same thing!" Haskell can get away with this because it is a pure language. If you have `f a b`, you do not really care when f gets evaluated (or, at least, when you do care currying is generally not what makes figuring it out difficult). Even without currying, Haskell makes it difficult to know when a function is evaluated.