import { newtype } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { iso } = newtype;
If the Newtype and its underlying value are referentially transparent (meaning they can always be swapped) then you can create an instance of Iso for the Newtype for mapping back and forth.
Type Parameters
T extends AnyNewtype