Skip to main content
Module

x/fun/optic.ts>review

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

A pipeable review function that applies a value A to the the review function of a Reviewer<S, A>. It returns a value S.

Examples

Example 1

import * as O from "./optic.ts";
import * as S from "./set.ts";
import { pipe } from "./fn.ts";

const numberSet = O.refold<ReadonlySet<number>, number>(
  Array.from,
  S.wrap,
  S.map,
);

const result = pipe(numberSet, O.review(1)); // ReadonlySet(1)

Returns

<S>(reviewer: Reviewer<S, A>) => S