Skip to main content
Module

x/fun/mod.ts>optics.Lens

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

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>