3 ms·
> more of a criticism of ML syntax than of currying – all things are good in moderation. I don't follow this. My understanding is that currying is pure syntact
by munificent 13y ago
> more of a criticism of ML syntax than of currying – all things are good in moderation.
I don't follow this. My understanding is that currying is pure syntactic sugar: it's a cheap way to expression partial application.
What am I missing?
- catnaroek 13y agoIt is not syntactic sugar. It is one of two demonstrably equivalent ways to emulate functions of two arguments. The demonstrable equivalence comes from the equational theory of cartesian closed categories. The need to emulate functions of more than one variable comes from the fact that only functions of one variable are a native concept.
- Peaker 13y agoThe word is encode, not emulate. Native support isn't any more concise, in fact it is more verbose when partial application is involved. So why complicate the language with native support for a feature whose encoding on top of one argument functions is concise, elegant, and works well?
- catnaroek 13y ago> Native support isn't any more concise, in fact it is more verbose when partial application is involved. I only know too well. Everytime I write stuff like using std::placeholders; std::bind(foo, bar, _1, _2, baz, _3, _4); I wish I were using an applicative language instead.