Skip to main content
Module

x/fun/mod.ts>decoder.wrap

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.wrap
import { decoder } from "https://deno.land/x/fun@v2.0.0-alpha.12/mod.ts";
const { wrap } = decoder;

Create a Decoder<D, A> from a constant value A.

Examples

Example 1

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

const one = D.wrap("one");

const result = one(null); // Right("one")

Type Parameters

A
optional
D = unknown