Closed mmuurr closed 1 year ago
Thanks for filing this issue! Unfortunately, while I think it's an interesting idea, I think it's out of scope for this package: developing good software requires relentless focus, which means that we have to say no to many good ideas. Even though I'm closing this issue, I really appreciate the feedback, and hope you'll continue to contribute in the future 😄
At times I find it's useful to retain the original function when passed to an adverb, such as
possibly()
. Obviously, when the original function is available by direct reference, this is a non-issue:But when using adverbs in a slightly more functional (and less-declarative) manner, I find I like to do something like this:
... and when wanting to do something with the original function I do (something along the lines of):
That ^ approach is a bit of a leaky abstraction, so I'm wondering if there's appetite for an accessor like:
The only {purrr} adverb where that example API wouldn't really work is
compose()
, though a more generic:... could yield a list of functions.
Just a thought, as whenever I find myself plucking objects out of a function's environment I think to myself, "this is unsafe" :-)
Cheers!