Open jstcki opened 10 years ago
Partial application should solve this issue in a language level, I think.
Also, probably better way is add examples how users could use currying to existing sprout methods. Like this:
const { curryRight } = require('robust-and-already-exists-curry-library')
const getName = curryRight(sprout.get, 'name')
getName({name: 'foo'}) // => 'foo'
getName({name: 'bar'}) // => 'bar'
someArray.map(getName)
It would be nice if there were alternative Sprout functions which took the object as the last argument or even better created partially applied functions.
They could be named with the suffix 'With', similar like in allong.es.
For example: