import { Either } from './Either' ; import { chain } from './chain' ; import { curry2 } from '@typed/functions' ; name export const map = curry2 ( __map ) ; function __map < A , B , C > ( f , either ) { return chain ( value => Either . of ( f ( value ) ) , either ) ; } export type EitherMap = { < A , B , C > ( f , either ) : Either < A , C > ; < A , B , C > ( f ) : ( either : Either < A , B > ) => Either < A , C > ; } ;