I'd love to have the P combinator available in Ramda.
const on = R.curry((f, g, a, b) => f(g(a))(g(b)))
thoughts?
Edit: some examples:
const eqBy = on(R.equals)
const mergeOn = on(R.mergeLeft)
const mergeProp = p => mergeOn(R.propOr({}, p))
const searchInsensitive = on(R.includes, R.toLower)
I like this function enough that I added it into Sanctuary! I can't recall why we did't add it to Ramda, but I think that if you made a PR we would give it a fair shake.
Would you be interested in working on this?
I would love to help, what's the best way to start?
:herb: Welcome Daniel!
I keep missing this function. It would be great to include.
To get started, you can read our Contributing article, and mostly just follow the style of existing functions. You will need to create a new source file, a test file, and an update to index.js. The implementation should be straightforward, since there are no performance concerns.
Most helpful comment
I would love to help, what's the best way to start?