Skip to main content
Module

x/fun/mod.ts>optic.Prism

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

Prism<S, A> is an alias of AffineFold<S, A> & Reviewer<S, A>. This means that a Prism operates exactly like an AffineFold with the added ability to reconstruct an S from an A. Examples of this are reconstructing an Option from a number, or reconstructing Either<string, number> from a string or a number.

definition: AffineFold<S, A> & Reviewer<S, A>