Skip to main content
Module

x/fun/mod.ts>fn.unsafeCoerce

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

Does an unsafe type coercion on any type. This is only safe when the types A and I have referential transparency. This is to say when the type A can be substituted for I and I for A at runtime without there being any change to the operation of the program. The primary use case for unsafeCoerce is in Newtype implementations.