Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

fold

import { fold } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/sync.ts";

Fold over a Sync computation to produce a single value.

@example
import { fold, wrap } from "./sync.ts";

const syncValue = wrap(5);
const result = fold(
  (acc: number, value: number) => acc + value,
  0
)(syncValue);

console.log(result); // 5
function fold<A, O>(foao: (o: O, a: A) => O, o: O): (ta: Sync<A>) => O;
§
fold<A, O>(foao: (o: O, a: A) => O, o: O): (ta: Sync<A>) => O
[src]

§Type Parameters

§Parameters

§
foao: (o: O, a: A) => O
[src]

§Return Type

§
(ta: Sync<A>) => O
[src]