Skip to main content
Module

x/fun/mod.ts>newtype.From

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

Extracts the inner type value from a Newtype.

Examples

Example 1

import type { Newtype, From } from "./newtype.ts";

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

type InnerInteger = From<Integer>; // number
definition: T extends Newtype<infer _, infer A> ? A : never