Skip to main content
Module

x/fun/mod.ts>optics.Fold

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
type alias optics.Fold
import { type optics } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { Fold } = optics;

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>