Skip to main content
Module

x/fun/mod.ts>optic.Fold

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
type alias optic.Fold
import { type optic } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { Fold } = optic;

Fold<S, A> is an alias of Optic<FoldTag, S, A>. This means that the view function of a Fold returns a ReadonlyArray, (s: S) => ReadonlyArray<A>. Some example Folds are accessing all of the values in a Record, Tree, Set, etc. In general, a Fold is used for focusing on any number of values A contained in the value S.

definition: Optic<FoldTag, S, A>