/**
 * `Monoid` extends the power of `Semigroup` by providing an additional `empty` value.
 *
 * ```ts
 * interface Semigroup<A> {
 *   readonly concat: (x: A, y: A) => A
 * }
 *
 * interface Monoid<A> extends Semigroup<A> {
 *   readonly empty: A
 * }
 * ```
 *
 * This `empty` value should be an identity for the `concat` operation, which means the following equalities hold for
 * any choice of `x`.
 *
 * Many types that form a `Semigroup` also form a `Monoid`, such as `number`s (with `0`) and `string`s (with `''`).
 *
 * ```ts
 * import { Monoid } from '@fp-tx/core/Monoid'
 *
 * const monoidString: Monoid<string> = {
 *   concat: (x, y) => x + y,
 *   empty: '',
 * }
 * ```
 *
 * _Adapted from https://typelevel.org/cats_
 *
 * @remarks
 * Added in 1.0.0
 * @packageDocumentation
 */
import { type Bounded } from "./Bounded.js";
import { type Endomorphism } from "./Endomorphism.js";
import { type ReadonlyRecord } from "./ReadonlyRecord.js";
import * as Se from "./Semigroup.js";
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface Monoid<A> extends Se.Semigroup<A> {
    readonly empty: A;
}
/**
 * Get a monoid where `concat` will return the minimum, based on the provided bounded order.
 *
 * The `empty` value is the `top` value.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Constructors
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import * as N from '@fp-tx/core/number'
 * import * as M from '@fp-tx/core/Monoid'
 *
 * const M1 = M.min(N.Bounded)
 *
 * assert.deepStrictEqual(M1.concat(1, 2), 1)
 * ```
 *
 * @public
 */
export declare const min: <A>(B: Bounded<A>) => Monoid<A>;
/**
 * Get a monoid where `concat` will return the maximum, based on the provided bounded order.
 *
 * The `empty` value is the `bottom` value.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Constructors
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import * as N from '@fp-tx/core/number'
 * import * as M from '@fp-tx/core/Monoid'
 *
 * const M1 = M.max(N.Bounded)
 *
 * assert.deepStrictEqual(M1.concat(1, 2), 2)
 * ```
 *
 * @public
 */
export declare const max: <A>(B: Bounded<A>) => Monoid<A>;
/**
 * The dual of a `Monoid`, obtained by swapping the arguments of `concat`.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import { reverse } from '@fp-tx/core/Monoid'
 * import * as S from '@fp-tx/core/string'
 *
 * assert.deepStrictEqual(reverse(S.Monoid).concat('a', 'b'), 'ba')
 * ```
 *
 * @public
 */
export declare const reverse: <A>(M: Monoid<A>) => Monoid<A>;
/**
 * Given a struct of monoids returns a monoid for the struct.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import { struct } from '@fp-tx/core/Monoid'
 * import * as N from '@fp-tx/core/number'
 *
 * interface Point {
 *   readonly x: number
 *   readonly y: number
 * }
 *
 * const M = struct<Point>({
 *   x: N.MonoidSum,
 *   y: N.MonoidSum,
 * })
 *
 * assert.deepStrictEqual(M.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })
 * ```
 *
 * @public
 */
export declare const struct: <A>(monoids: { [K in keyof A]: Monoid<A[K]>; }) => Monoid<{ readonly [K_1 in keyof A]: A[K_1]; }>;
/**
 * Given a tuple of monoids returns a monoid for the tuple.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import { tuple } from '@fp-tx/core/Monoid'
 * import * as B from '@fp-tx/core/boolean'
 * import * as N from '@fp-tx/core/number'
 * import * as S from '@fp-tx/core/string'
 *
 * const M1 = tuple(S.Monoid, N.MonoidSum)
 * assert.deepStrictEqual(M1.concat(['a', 1], ['b', 2]), ['ab', 3])
 *
 * const M2 = tuple(S.Monoid, N.MonoidSum, B.MonoidAll)
 * assert.deepStrictEqual(M2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false])
 * ```
 *
 * @public
 */
export declare const tuple: <A extends readonly unknown[]>(...monoids: { [K in keyof A]: Monoid<A[K]>; }) => Monoid<Readonly<A>>;
/**
 * Given a sequence of `as`, concat them and return the total.
 *
 * If `as` is empty, return the monoid `empty` value.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import { concatAll } from '@fp-tx/core/Monoid'
 * import * as N from '@fp-tx/core/number'
 *
 * assert.deepStrictEqual(concatAll(N.MonoidSum)([1, 2, 3]), 6)
 * assert.deepStrictEqual(concatAll(N.MonoidSum)([]), 0)
 * ```
 *
 * @public
 */
export declare const concatAll: <A>(M: Monoid<A>) => (as: readonly A[]) => A;
/**
 * Use [`Monoid`](./void.ts.html#monoid) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidVoid: Monoid<void>;
/**
 * Use [`tuple`](#tuple) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getTupleMonoid: <T extends ReadonlyArray<Monoid<any>>>(...monoids: T) => Monoid<{
    [K in keyof T]: T[K] extends Se.Semigroup<infer A> ? A : never;
}>;
/**
 * Use [`struct`](#struct) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getStructMonoid: <O extends ReadonlyRecord<string, any>>(monoids: {
    [K in keyof O]: Monoid<O[K]>;
}) => Monoid<O>;
/**
 * Use [`reverse`](#reverse) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getDualMonoid: <A>(M: Monoid<A>) => Monoid<A>;
/**
 * Use [`max`](#max) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getJoinMonoid: <A>(B: Bounded<A>) => Monoid<A>;
/**
 * Use [`min`](#min) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getMeetMonoid: <A>(B: Bounded<A>) => Monoid<A>;
/**
 * Use [`concatAll`](#concatall) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const fold: <A>(M: Monoid<A>) => (as: readonly A[]) => A;
/**
 * Use [`MonoidAll`](./boolean.ts.html#monoidall) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidAll: Monoid<boolean>;
/**
 * Use [`MonoidAny`](./boolean.ts.html#monoidany) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidAny: Monoid<boolean>;
/**
 * Use [`getMonoid`](./function.ts.html#getmonoid) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getFunctionMonoid: <M>(M: Monoid<M>) => <A = never>() => Monoid<(a: A) => M>;
/**
 * Use [`getEndomorphismMonoid`](./function.ts.html#getendomorphismmonoid) instead.
 *
 * **Note**. The execution order in [`getEndomorphismMonoid`](./function.ts.html#getendomorphismmonoid) is reversed.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const getEndomorphismMonoid: <A = never>() => Monoid<Endomorphism<A>>;
/**
 * Use [`Monoid`](./string.ts.html#monoid) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidString: Monoid<string>;
/**
 * Use [`MonoidSum`](./number.ts.html#monoidsum) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidSum: Monoid<number>;
/**
 * Use [`MonoidProduct`](./number.ts.html#monoidproduct) instead.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @deprecated Zone of Death
 * @public
 */
export declare const monoidProduct: Monoid<number>;
//# sourceMappingURL=Monoid.d.ts.map