UNPKG

crocks

Version:

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

16 lines (11 loc) 403 B
/** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = require('../core/curry') var isFunction = require('../core/isFunction') function option(x, m) { if(!(m && isFunction(m.option))) { throw new TypeError('option: Last argument must be a Maybe, First or Last') } return m.option(x) } module.exports = curry(option)