Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fun/optics.ts>compose

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function compose
import { compose } from "https://deno.land/x/fun@v2.0.0-alpha.6/optics.ts";

Compose two Optics by:

  1. Finding the alignment of them, which is Max<first, second> where Fold > Affine > Get
  2. Cast both optics to the alignment tag, one cast will always be a noop.
  3. Construct a new optic by chaining the view functions first to second and composing the modify functions second to first.

Type Parameters

V extends Tag
A
I

Parameters

second: Optic<V, A, I>