Proposed: _.call2, _.mapArgs, and _.mapArgsWith#32
Proposed: _.call2, _.mapArgs, and _.mapArgsWith#32fogus merged 5 commits intodocumentcloud:masterfrom raganwald:master
Conversation
|
One (strong) way that I diverge philosophically from _ is in my view on "magic" arguments. With that said, Looking over your mappy function one thing that jumped out at me was that |
|
With However, I can see the argument that _.contrib is a different world, so I will make it rain accordingly. |
|
I've reviewed |
Proposed: _.call2, _.mapArgs, and _.mapArgsWith
_.call2is a utility-function that subsumes calling, partial application, and currying. You can write:This facilitates a lot of other combinator writing.
_.mapArgstakes a function and returns a version that performs a map on its arguments. Example:_.mapArgsWithis the same thing, with its arguments flipped to facilitate partial application of the mapper as a decorator.These functions are integral to a post I'm writing about underscore-contrib :-)