Hacker News new | ask | show | jobs
by kerkeslager 809 days 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.

1 comments

You 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.