/** * @since 1.0.0 */ import type { Kind, TypeClass, TypeLambda } from "@fp-ts/core/HKT"; import type { Coproduct } from "@fp-ts/core/typeclass/Coproduct"; import type { Monad } from "@fp-ts/core/typeclass/Monad"; import type { Monoid } from "@fp-ts/core/typeclass/Monoid"; /** * @category type class * @since 1.0.0 */ export interface Foldable extends TypeClass { readonly reduce: { (b: B, f: (b: B, a: A) => B): (self: Kind) => B; (self: Kind, b: B, f: (b: B, a: A) => B): B; }; } /** * Returns a default ternary `reduce` composition. * * @since 1.0.0 */ export declare const reduceComposition: (F: Foldable, G: Foldable) => (self: Kind>, b: B, f: (b: B, a: A) => B) => B; /** * @since 1.0.0 */ export declare const toArrayMap: (F: Foldable) => { (f: (a: A) => B): (self: Kind) => B[]; (self: Kind, f: (a: A_1) => B_1): B_1[]; }; /** * @since 1.0.0 */ export declare const toArray: (F: Foldable) => (self: Kind) => A[]; /** * @since 1.0.0 */ export declare const combineMap: (F: Foldable) => (M: Monoid) => { (f: (a: A) => M): (self: Kind) => M; (self: Kind, f: (a: A_1) => M): M; }; /** * @since 1.0.0 */ export declare const reduceKind: (F: Foldable) => (G: Monad) => { (b: B, f: (b: B, a: A) => Kind): (self: Kind) => Kind; (self: Kind, b: B_1, f: (b: B_1, a: A_1) => Kind): Kind; }; /** * @since 1.0.0 */ export declare const coproductMapKind: (F: Foldable) => (G: Coproduct) => { (f: (a: A) => Kind): (self: Kind) => Kind; (self: Kind, f: (a: A_1) => Kind): Kind; }; //# sourceMappingURL=Foldable.d.ts.map