> It's extremely rare that you need to (printf "%d %d" foo)
I write stuff like `map (printf "%d %d" m) ns` all the time. I daresay I even do the map as a partial application, so double currying.
I write stuff like `map (printf "%d %d" m) ns` all the time. I daresay I even do the map as a partial application, so double currying.
I don't think parent is saying that partial application is bad, far from it. But to a reader it is valuable information whether it's partial or full application.
- `iter`: this is a side-effect on a collection
- `(printf`: ok, this is just printing, I don't care about what is printed, let's skip to the `)`
- ns: ok, this is the collection being printed
Notice that having a lambda or a partial application `_` will only add noise here.> But to a reader it is valuable information whether it's partial or full application.
This can be a valuable information in some context, but in a functional language, functions are values. Thus a "partial application" (in term of closure construction) might be better read as a full application because the main type of concern in the current context is a functional type.