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

collapse

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

Collect all values in a ReadonlyRecord into a single value I by using a Combinable. This is effectively fold using a Combinable for the initial value and combination.

@example
import * as R from "./record.ts";
import { InitializableNumberSum } from "./number.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  { one: 1, two: 2, three: 3 },
  R.collapse(InitializableNumberSum),
); // 6
function collapse<A>(M: Initializable<A>): (ua: ReadonlyRecord<A>) => A;
§
collapse<A>(M: Initializable<A>): (ua: ReadonlyRecord<A>) => A
[src]

§Type Parameters

§Parameters

§Return Type

§
(ua: ReadonlyRecord<A>) => A
[src]