Closed dillonforrest closed 10 years ago
@dillonforrest Thanks! I don't see any reason why there couldn't be like a curryRight
, pipelineCurry
, or variant if there's value in it. In just thinking about the implementation, it should be simple enough as fn.reverse
on the arguments, but it would probably take a little refactor on fn.curry
to make it easily extensible to a reversed version. Thoughts?
Also, there is already a reversed version of fn.compose
with fn.pipeline
, just fyi.
@eliperelman I think you're right. There are a ton of options. At the moment, none of them stick out as obvious best choices for me.
I just checked out the source. I think something similar to fn.compose
would already be good for fn.curryRight
.
Also, this made me realize that maybe a similarly implemented fn.reduceRight
would be helpful!
If you'd like, I can submit a pull request later on!
I'd absolutely welcome a pull request.
@dillonforrest In case you hadn't seen it, there is now fn.flip
which reverses the arguments of a given function.
Closing for now until there is submitted functionality.
@eliperelman Okay cool, thanks!
Hi there! Just discovered fn.js. Looks awesome!! :)
I noticed that
fn.curry
ends up currying the arguments from left to right. I'm wondering how you'd feel about currying right-to-left. Standard partial applications already go left to right, so I figure currying right to left would be more composable.What are your thoughts?