crocks
Version:
A collection of well known Algebraic Datatypes for your utter enjoyment.
16 lines (11 loc) • 403 B
JavaScript
/** @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 evalWith(x, m) {
if(!(m && isFunction(m.evalWith))) {
throw new TypeError('evalWith: State required for second argument')
}
return m.evalWith(x)
}
module.exports = curry(evalWith)