/** * Foldable is a structure that allows a function to all values inside of a * structure. The reduction is accumulative and ordered. * * @module Foldable * @since 2.0.0 */ import "./_dnt.polyfills.js"; import type { $, Hold, Kind } from "./kind.js"; import type { Initializable } from "./initializable.js"; /** * A Foldable structure has the method fold. * * @since 2.0.0 */ export interface Foldable extends Hold { readonly fold: (reducer: (accumulator: O, value: A) => O, accumulator: O) => (ua: $) => O; } /** * @experimental * @since 2.0.0 */ export declare function collect({ fold }: Foldable, { combine, init }: Initializable): (ua: $) => A;