Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

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>