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