Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/flatmappable.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/flatmappable.ts";

Flatmappable is a structure that allows a function that returns the concrete structure to be applied to the value inside of the same type of concrete structure. The resultant nested structure is then flattened.

Functions

Create a bind function for a structure with instances of Mappable and Flatmappable. A bind function allows one to flatmap into named fields in a struct, collecting values from the result of the flatmap in the order that they are completed.

Derive a Flatmappable instance from unwrap, flatmap, and a Kind. This is the simplest way to get a Flatmappable instance.

Create a tap function for a structure with instances of Wrappable and Flatmappable. A tap function allows one to break out of the functional codeflow. It is generally not advised to use tap for code flow but to consider an escape hatch to do things like tracing or logging.

Interfaces

A Flatmappable structure.