import { curry } from '@typed/lambda'
import { chainLeft } from './chainLeft'
import { Either } from './Either'
/**
* Returns a `Either` that is the result of calling `f` with the resolved
* value of another `Either`.
* @name mapLeft(f: (value: A) => C, either: Either): Either
*/
export const mapLeft = curry(__mapLeft) as {
(f: (value: A) => C, either: Either): Either
(f: (value: A) => C): (either: Either) => Either
}
function __mapLeft(f: (value: A) => C, either: Either): Either {
return chainLeft((value) => Either.left(f(value)), either)
}