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

getFlatmappableRight

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

Create a Flatmappable instance for Either with a fixed left type. This is useful when you want to maintain a consistent error type throughout a computation chain.

@example
import * as E from "./either.ts";
import * as S from "./string.ts";

const flatmappableEither = E.getFlatmappableRight(S.CombinableString);

const result = flatmappableEither.flatmap((n: number) =>
  n > 0 ? E.right(n * 2) : E.left("Number must be positive")
)(E.right(5));
// Right(10)
function getFlatmappableRight<E>({ combine }: Combinable<E>): Flatmappable<KindRightEither<E>>;
§
getFlatmappableRight<E>({ combine }: Combinable<E>): Flatmappable<KindRightEither<E>>
[src]

§Type Parameters

§Parameters

§
{ combine }: Combinable<E>
[src]