Skip to main content
Module

x/fun/mod.ts>newtype.getInitializable

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function newtype.getInitializable
import { newtype } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { getInitializable } = newtype;

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

Examples

Example 1

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

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

const monoidInteger = getInitializable<Integer>(N.InitializableNumberSum);

Parameters

initializable: Initializable<ToValue<T>>

Returns

Initializable<T>