I'm trying to create a curriable function that returns whether or not the supplied length is equal to the length of the supplied string. I'd like it to work like this:
checkLength(3)('asdf') // => false
checkLength(4)('asdf') // => true
I initially tried this, but the argument order is reversed because it returns the curried equals
function:
const checkLength = R.compose(R.equals(), R.prop('length'))
checkLength('asdf')(4)
I can fix by wrapping it in a function like this:
const checkLength = (len) => R.compose(R.equals(len), R.prop('length'))
But it seems like there would be a way to use the functional library to solve this. Anyone have any ideas?