Skip to main content
Module

x/fun/decode_error.ts>fold

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

Parameters

Leaf: (value: unknown, reason: string) => O
Wrap: (error: string, errors: DecodeError) => O
Key: (
key: string,
property: Property,
errors: DecodeError,
) => O
Index: (
index: number,
property: Property,
errors: DecodeError,
) => O
Union: (errors: readonly [DecodeError, ...DecodeError[]]) => O
Intersection: (errors: readonly [DecodeError, ...DecodeError[]]) => O
Many: (errors: readonly DecodeError[]) => O