crocks
Version:
A collection of well known Algebraic Datatypes for your utter enjoyment.
21 lines (16 loc) • 539 B
JavaScript
/** @license ISC License (c) copyright 2016 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */
var compose = require('../core/compose')
var curry = require('../core/curry')
var isFunction = require('../core/isFunction')
// Composition (Bluebird)
// composeB :: (b -> c) -> (a -> b) -> a -> c
function composeB(f, g) {
if(!(isFunction(f) && isFunction(g))) {
throw new TypeError(
'composeB: Functions required for first two arguments'
)
}
return compose(f, g)
}
module.exports = curry(composeB)