我怎样才能使以下函数成为 pointfree(使用 Ramda)?
const prefixAll = R.curry((prefix, list) => R.map(R.concat(prefix), list))
最佳答案
此外,这应该有效
R.useWith(R.map, [R.concat, R.identity])
(
R.identity
is there for proper arity of the function, see @scott-sauyet's comment.)
P.S:但我个人认为,compose
更好——使用参数的部分应用是更实用的方法。例如R.compose(R.map, R.concat)('a')(['a','b'])
关于javascript - 使用 Ramda 使函数 pointfree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43869365/