Skip to main content
Module

x/fun/fn_either.ts>getRightMonad

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function getRightMonad
import { getRightMonad } from "https://deno.land/x/fun@v.2.0.0-alpha.11/fn_either.ts";

Create a Monad for FnEither where left values are combined using the supplied Semigroup.

Examples

Example 1

import * as FE from "./fn_either.ts";
import { SemigroupNumberSum } from "./number.ts";
import { pipe } from "./fn.ts";

const { ap } = FE.getRightMonad(SemigroupNumberSum);

const result1 = pipe(
  FE.left(1),
  ap(FE.left(1)),
); // Left(2)