fold
import { fold } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/free.ts";Fold over a Free structure to produce a single value.
@example
import { fold, node, link } from "./free.ts";
import { pipe } from "./fn.ts";
const free = link(node(1), node(2));
const sum = pipe(
free,
fold(
(value, acc) => value + acc,
0
)
);
console.log(sum); // 3