import { Future } from './Future' ; import { chain } from './chain' ; import { curry2 } from '@typed/functions' ; import { map } from './map' ; name export const ap = curry2 ( __ap ) ; function __ap < A , B , C > ( fn , value ) { return chain ( f => map ( f , value ) , fn ) ; } export type FutureAp = { < A , B , C > ( fn , value ) : Future < A , C > ; < A , B , C > ( fn ) : ( value : Future < A , B > ) => Future < A , C > ; } ;