Skip to main content
Module

x/fun/failable.ts

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

Failable is a compound structure. It represents the idea of failure. As such it includes methods for creating a failed data, providing alternative data, and recovering from a failed state (effectively flatMapping from the failed value).

Functions

Create a tryAll function from an instance of Failable. The tryAll function allows the trying any number of Failable structures in order until a non-failed one is found.

Interfaces

A Failable structure is a Flatmappable that allows for alternative instances, failures, and recovery.