Skip to main content
Module

x/fun/mod.ts>combinable.getCombineAll

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

Given a Combinable, 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 C from "./combinable.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";

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

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

Returns

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