crocks
Version:
A collection of well known Algebraic Datatypes for your utter enjoyment.
19 lines (13 loc) • 450 B
JavaScript
/** @license ISC License (c) copyright 2018 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */
var curry = require('../core/curry')
var isSameType = require('../core/isSameType')
var Async = require('../core/types').proxy('Async')
function race(m, a) {
if(!(isSameType(m, a) && isSameType(Async, m))) {
throw new TypeError('race: Both arguments must be Asyncs')
}
return a.race(m)
}
module.exports =
curry(race)