UNPKG

crocks

Version:

A collection of well known Algebraic Datatypes for your utter enjoyment.

23 lines (17 loc) 606 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = require('../core/curry') var curryN = require('../core/curryN') var isFunction = require('../core/isFunction') var isNumber = require('../core/isNumber') // nAry : Number -> (* -> a) -> * -> * -> a function nAry(num, fn) { if(!isNumber(num)) { throw new TypeError('nAry: Number required for first argument') } if(!isFunction(fn)) { throw new TypeError('nAry: Function required for second argument') } return curryN(num, fn) } module.exports = curry(nAry)