import { dimap } from "https://deno.land/x/fun@v2.0.0/fn_either.ts";
Map over the input of a FnEither contravariantly and the right result of a FnEither covariantly.
Examples
Example 1
Example 1
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";
// This has type FnEither<[Date], never, string>
const computation = pipe(
FE.id<number>(),
FE.dimap(
(d: Date) => d.valueOf(),
String,
),
);
const result = computation(new Date(0)); // Right('0')