3 ms·
> Is the former not just sugar for the latter? Theoretically they're equivalent, but practically not really especially when you introduce more complicated "imp
by masklinn 5y ago
> Is the former not just sugar for the latter?
Theoretically they're equivalent, but practically not really especially when you introduce more complicated "imperative" features e.g. default parameters or overloading.
They also have API impacts e.g. because Haskell is curried, its HoFs are generally of the form `fn param`, that way you can trivially partially apply the callback and use the same partially applied function to different parameters.
In method-based languages, there is no way to partially apply the callback, and in uncurried languages in general since partial application is a secondary concern you'll often see the callback last regardless so the non-callback parameters don't "get lost" at the tail end of a long callback.
- brundolf 5y agoAh that makes sense about default parameters and overloading. Hmm.