import { chain } from "https://deno.land/x/fun@v2.0.0-alpha.6/set.ts";
Given a function A -> ReadonlySet and a ReadonlySet return a ReadonlySet created by applying the function to every value A and joining all the resulting ReadonlySets.
Examples
Example 1
Example 1
import * as S from "./set.ts";
import { pipe } from "./fn.ts";
const set = S.set(1, 2, 3, 4, 5);
const result = pipe(
set,
S.chain(n => S.set(n, n + 1, n + 2)),
); // Set(1, 2, 3, 4, 5, 6, 7);