Skip to main content
Module

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

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.