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/sync_either.ts";

Chain SyncEither computations together.

@example
import { flatmap, right } from "./sync_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  right(5),
  flatmap(n => right(n * 2))
);

const value = result(); // Right(10)
function flatmap<A, I, J>(faui: (a: A) => SyncEither<J, I>): <B>(ua: SyncEither<B, A>) => SyncEither<B | J, I>;
§
flatmap<A, I, J>(faui: (a: A) => SyncEither<J, I>): <B>(ua: SyncEither<B, A>) => SyncEither<B | J, I>
[src]

§Type Parameters

§Parameters

§
faui: (a: A) => SyncEither<J, I>
[src]

§Return Type

§
<B>(ua: SyncEither<B, A>) => SyncEither<B | J, I>
[src]