Skip to main content
Module

x/fun/mod.ts>tree.match

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

The match function is a recursive fold that collapses a Tree into a single value I. It does this from the head of the Tree first.

Parameters

fai: (a: A, is: Array<I>) => I

Returns

(ta: Tree<A>) => I