Skip to main content
Module

x/fun/mod.ts>decoder.unionErr

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 decoder.unionErr
import { decoder } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { unionErr } = decoder;

Construct a Union from two or more DecodeErrors.

Examples

Example 1

import * as D from "./decoder.ts";

const result = D.unionErr(
  D.leafErr(1, "expected string"),
  D.leafErr(1, "expected array"),
);

Parameters

...errors: readonly [DecodeError, DecodeError, ...DecodeError[]]