Skip to main content
Module

x/fun/mod.ts>optics.Prism

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.Prism
import { type optics } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { Prism } = optics;

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>