import { Maybe } from './Maybe' ; import { chain } from './chain' ; import { curry2 } from '@typed/functions' ; name export const map = curry2 ( __map ) ; function __map < A , B > ( f , maybe ) { return chain ( a => Maybe . of ( f ( a ) ) , maybe ) ; } export interface MaybeMap { < A , B > ( f , maybe ) : Maybe < B > ; < A , B > ( f ) : ( maybe : Maybe < A > ) => Maybe < B > ; }