Skip to main content
Module

x/fun/decoder.ts>failure

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function failure
import { failure } from "https://deno.land/x/fun@v2.0.0/decoder.ts";

Construct a Decoded failure. Specifically, this constructs a Leaf DecodeError and wraps it in Left.

Examples

Example 1

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

const result1 = D.failure(1, "string");
// Represents a Decoded value that failed because a 1 was supplied
// when a string was expected.

Type Parameters

optional
A = never

Parameters

actual: unknown
error: string