import { Arity2 , curry2 } from '@typed/functions' ; import { Index , List } from '../types' ; import { chain } from '../chain' ; import { map } from '../map' ; export const ap = curry2 ( __ap ) ; export type ListAp = { < A , B > ( fns , values ) : Array < B > ; < A , B > ( fns ) : ( values : List < A > ) => Array < B > ; } ; function __ap < A , B > ( fns , values ) { return chain ( ( fn ) => map ( fn , values ) , fns ) ; }