Skip to main content
Module

x/fun/optic.ts>Viewer

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
interface Viewer
import { type Viewer } from "https://deno.land/x/fun@v2.0.0/optic.ts";

A Viewer<T, S, A> implements a view function (s: S) => T<A>. This is effectively a Kliesli Arrow. The valid types of T are Identity, Option, and Array. Viewer also includes a runtime tag corresponding to the return type of the view function to aid in composition.

Type Parameters

T extends Tag
S
A

Properties

readonly
tag: T
readonly
view: (s: S) => $<ToKind<T>, [A, never, never]>