pnpm
Version:
Fast, disk space efficient package manager
21 lines (18 loc) • 743 B
JavaScript
/** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
import { combine } from './combine'
import { apply } from '@most/prelude'
/**
* Assume fs is a stream containing functions, and apply the latest function
* in fs to the latest value in xs.
* fs: --f---------g--------h------>
* xs: -a-------b-------c-------d-->
* ap(fs, xs): --fa-----fb-gb---gc--hc--hd->
* @param {Stream} fs stream of functions to apply to the latest x
* @param {Stream} xs stream of values to which to apply all the latest f
* @returns {Stream} stream containing all the applications of fs to xs
*/
export function ap (fs, xs) {
return combine(apply, fs, xs)
}