import { Arity1, curry } from '@typed/lambda' import { chain } from './chain' import { map } from './map' /** * Apply an async iterable of functions to an async iterable of values. */ export const ap = curry( (fn: Iterable>, value: Iterable): Iterable => chain((f) => map(f, value), fn), ) as { (fn: Iterable>, value: Iterable): Iterable (fn: Iterable>): (value: Iterable) => Iterable }