Skip to main content
Module

x/fun/mod.ts>optics.props

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

Given an Optic over a structure with properties P, construct a new optic that only focuses on those properties

Type Parameters

A
P extends keyof A

Parameters

...props: [P, P, ...Array<P>]

Returns

<U extends Tag, S>(first: Optic<U, S, A>) => Optic<Align<U, GetTag>, S, [K in P]: A[K]>