UNPKG

moy-fp

Version:
12 lines (9 loc) 218 B
import curry from './curry' import nAry from './nAry' /** * ((a, b, ..., m) -> n) -> ((b, a, ..., m) -> n) */ const flip = curry( fn => nAry(fn.length, (a, b, ...args) => fn(b, a, ...args)) ) export default flip