import { decoder } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { unwrap } = decoder;
A combinator over Decoded that maps a DecodeError into a printable tree.
Examples
Example 1
Example 1
import * as D from "./decoder.ts";
import { pipe } from "./fn.ts";
const result1 = pipe(
D.failure(1, "string"),
D.unwrap,
); // Left("cannot decode 1, should be string")
const result2 = pipe(
D.success(1),
D.unwrap
); // Right(1)