Skip to main content
Module

x/fun/decoder.ts>boolean

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

A Decoder that validates booleans.

Examples

Example 1

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

const result1 = D.boolean(null); // Left(DecodeError)
const result2 = D.boolean(true); // Right(true)

type

Decoder<unknown, boolean>