Skip to main content
Module

x/fun/mod.ts>fn_either.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 fn_either.getRightMonad
import { fn_either } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { getRightMonad } = fn_either;

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)

Parameters

unnamed 0: Semigroup<B>