Skip to main content
Module

x/fun/mod.ts>optic.Lens

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.Lens
import { type optic } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { Lens } = optic;

Lens<S, A> is an alias of Optic<LensTag, S, A>. This means that the view function of a Lens returns a pure A value. (s: S) => A. Some example lenses are accessing the property of a struct, accessing the first value in a Pair, and the trivial identity Lens. In general, a Lens is used for focusing on exactly one value A contained in the value S.

definition: Optic<LensTag, S, A>