Skip to main content
Module

x/fun/mod.ts>optics.atKey

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

Given an optic over a record, focus on an Option(value) at the given key, allowing one to delete the key by modifying with a None value.

TODO: Clean this implementation up.

Parameters

key: string

Returns

<U extends Tag, S, A>(first: Optic<U, S, Readonly<Record<string, A>>>) => Optic<Align<U, GetTag>, S, Option<A>>