Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

premap

import { premap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn_either.ts";

Map over the input value of a FnEither.

@example
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";

// This has type FnEither<[Date], never, number>
const computation = pipe(
  FE.id<number>(),
  FE.premap((d: Date) => d.valueOf()),
);

const result = computation(new Date(0)); // Right(0)
function premap<L, D>(fld: (l: L) => D): <A, B>(ua: FnEither<D, B, A>) => FnEither<L, B, A>;
§
premap<L, D>(fld: (l: L) => D): <A, B>(ua: FnEither<D, B, A>) => FnEither<L, B, A>
[src]

§Type Parameters

§Parameters

§
fld: (l: L) => D
[src]

§Return Type

§
<A, B>(ua: FnEither<D, B, A>) => FnEither<L, B, A>
[src]