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

flatmap

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

Chain the right result of one FnEither into another FnEither.

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

const result = pipe(
  FE.id<string>(),
  FE.flatmap(s => FE.right(s.length)),
)("Hello"); // Right(5)
function flatmap<A, L = unknown, J = never, I = never>(fati: (a: A) => FnEither<L, J, I>): <D = unknown, B = never>(ua: FnEither<D, B, A>) => FnEither<D & L, B | J, I>;
§
flatmap<A, L = unknown, J = never, I = never>(fati: (a: A) => FnEither<L, J, I>): <D = unknown, B = never>(ua: FnEither<D, B, A>) => FnEither<D & L, B | J, I>
[src]

§Type Parameters

§
L = unknown
[src]
§
J = never
[src]
§
I = never
[src]

§Parameters

§
fati: (a: A) => FnEither<L, J, I>
[src]

§Return Type

§
<D = unknown, B = never>(ua: FnEither<D, B, A>) => FnEither<D & L, B | J, I>
[src]