9 ms·
Currying and partial application are dualities (think of them as function introduction/function elimination), so neither subsumes the other one. However, I agr
by Hirrolot 2y ago
Currying and partial application are dualities (think of them as function introduction/function elimination), so neither subsumes the other one.
However, I agree with the wording of the original comment: when you _pass_ some arguments to a constructor and then to a method, this is (at least conceptually) partial application.
- kerkeslager 2y ago> Currying and partial application are dualities (think of them as function introduction/function elimination), so neither subsumes the other one. Could you say more? I'm not sure I understand what you're saying here.
- skybrian 2y agoYou can think of them as equivalent ways to write the same code. There are mechanical rewrites to go from one to the other, and these rewrites work in any direction. Which way is more readable depends on circumstances. When a function needs a lot of parameters to do a calculation, these parameters can be arbitrarily grouped into records and supplied in any order. Languages have convenient syntaxes for certain ways of grouping parameters together. For example, a closure creates a group of parameters in the form of a function.