Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as mod from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/free.ts";

This file contains the Free algebraic data type. Free is a data type that is used primarily to create a Combinable for any given data structure. It is useful when one wants to use combine things without deciding on a specific data structure to implement.

§Functions

apply

Apply a function wrapped in a Free to a value wrapped in a Free.

combine

Combine two Free structures.

flatmap

Chain Free computations together.

fold

Fold over a Free structure to produce a single value.

getCombinable

Create a Combinable instance for Free.

isLink

Check if a Free structure is a Link.

isNode

Check if a Free structure is a Node.

link

Create a Link combining two Free structures.

map

Apply a function to the value in a Free structure.

match

Pattern match on a Free structure to extract values.

node

Create a Node containing a single value.

wrap

Wrap a value in a Free structure.

§Interfaces

KindFree

Specifies Free as a Higher Kinded Type, with covariant parameter A corresponding to the 0th index of any substitutions.

§Type Aliases

Free

The Free type represents either a Node (single value) or a Link (combination of two Free structures).

Link

A Link represents a combination of two Free structures.

Node

A Node represents a single value in the Free structure.