Skip to main content
Module

x/fun/mod.ts>newtype.getMonoid

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 newtype.getMonoid
import { newtype } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { getMonoid } = newtype;

Retype an existing Monoid from an inner type to a Newtype.

Examples

Example 1

import { Newtype, getMonoid } from "./newtype.ts";
import * as N from "./number.ts";

type Integer = Newtype<'Integer', number>;

const monoidInteger = getMonoid<Integer>(N.MonoidNumberSum);

Parameters

monoid: Monoid<From<T>>

Returns

Monoid<T>