import { optic } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { composeReviewer } = optic;
Compose two reviewer functions, allowing one to create nested Reviewer structures.
Examples
Example 1
Example 1
import * as O from "./optic.ts";
import * as S from "./set.ts";
import { pipe } from "./fn.ts";
const set = <A>() => O.refold<ReadonlySet<A>, A>(
Array.from,
S.wrap,
S.map,
);
const sets = pipe(
set<ReadonlySet<number>>(),
O.composeReviewer(set()),
);
const result = sets.review(1); // Set(Set(1))