Skip to main content
Module

x/fun/decoder.ts>number

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

A Decoder that validates numbers.

Examples

Example 1

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

const result1 = D.number(null); // Left(DecodeError)
const result2 = D.number(1); // Right(1)

type

Decoder<unknown, number>