Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/monad.ts

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
import * as fun from "https://deno.land/x/fun@v.2.0.0-alpha.11/monad.ts";

Functions

Derive a Monad instance from of, chain, and a Kind. This is the simplest way to get a Monad instance when one has a creation function (of) and a chain function (aka flatMap or bind).

Interfaces

A Monad is an algebra with a notion of join(aka flatten or flat) for a given algebraic data type T. A Monad must also extend Functor, Apply, Applicative, and Chain. This means a Monad has the following methods: of, ap, map, join, and chain. An intuition for Monad can be found by thinking about how Promise.then handles functions that return a new Promise.