Skip to main content
Module

x/fun/mod.ts>initializable.getCombineAll

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function initializable.getCombineAll
import { initializable } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { getCombineAll } = initializable;

Given an Initializable, create a function that will iterate through an array of values and combine them. This is not much more than Array.fold(combine).

Examples

Example 1

import * as I from "./initializable.ts";
import * as N from "./number.ts";

const sumAll = I.getCombineAll(N.InitializableNumberSum);

const result = sumAll(1, 30, 80, 1000, 52, 42); // sum === 1205

Returns

(...as: ReadonlyArray<A>) => A