import { type Magma } from "./Magma.js";
import * as Or from "./Ord.js";
import { type Ord } from "./Ord.js";
import { type ReadonlyRecord } from "./ReadonlyRecord.js";
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface Semigroup<A> extends Magma<A> {
}
/**
 * Get a semigroup where `concat` will return the minimum, based on the provided order.
 *
 * @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 S from '@fp-tx/core/Semigroup'
 *
 * const S1 = S.min(N.Ord)
 *
 * assert.deepStrictEqual(S1.concat(1, 2), 1)
 * ```
 *
 * @public
 */
export declare const min: <A>(O: Or.Ord<A>) => Semigroup<A>;
/**
 * Get a semigroup where `concat` will return the maximum, based on the provided order.
 *
 * @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 S from '@fp-tx/core/Semigroup'
 *
 * const S1 = S.max(N.Ord)
 *
 * assert.deepStrictEqual(S1.concat(1, 2), 2)
 * ```
 *
 * @public
 */
export declare const max: <A>(O: Or.Ord<A>) => Semigroup<A>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Constructors
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare const constant: <A>(a: A) => Semigroup<A>;
/**
 * The dual of a `Semigroup`, 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/Semigroup'
 * import * as S from '@fp-tx/core/string'
 *
 * assert.deepStrictEqual(reverse(S.Semigroup).concat('a', 'b'), 'ba')
 * ```
 *
 * @public
 */
export declare const reverse: <A>(S: Semigroup<A>) => Semigroup<A>;
/**
 * Given a struct of semigroups returns a semigroup 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/Semigroup'
 * import * as N from '@fp-tx/core/number'
 *
 * interface Point {
 *   readonly x: number
 *   readonly y: number
 * }
 *
 * const S = struct<Point>({
 *   x: N.SemigroupSum,
 *   y: N.SemigroupSum,
 * })
 *
 * assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })
 * ```
 *
 * @public
 */
export declare const struct: <A>(semigroups: { [K in keyof A]: Semigroup<A[K]>; }) => Semigroup<{ readonly [K_1 in keyof A]: A[K_1]; }>;
/**
 * Given a tuple of semigroups returns a semigroup 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/Semigroup'
 * 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 S1 = tuple(S.Semigroup, N.SemigroupSum)
 * assert.deepStrictEqual(S1.concat(['a', 1], ['b', 2]), ['ab', 3])
 *
 * const S2 = tuple(S.Semigroup, N.SemigroupSum, B.SemigroupAll)
 * assert.deepStrictEqual(S2.concat(['a', 1, true], ['b', 2, false]), ['ab', 3, false])
 * ```
 *
 * @public
 */
export declare const tuple: <A extends readonly unknown[]>(...semigroups: { [K in keyof A]: Semigroup<A[K]>; }) => Semigroup<Readonly<A>>;
/**
 * Between each pair of elements insert `middle`.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import { intercalate } from '@fp-tx/core/Semigroup'
 * import * as S from '@fp-tx/core/string'
 * import { pipe } from '@fp-tx/core/function'
 *
 * const S1 = pipe(S.Semigroup, intercalate(' + '))
 *
 * assert.strictEqual(S1.concat('a', 'b'), 'a + b')
 * ```
 *
 * @public
 */
export declare const intercalate: <A>(middle: A) => (S: Semigroup<A>) => Semigroup<A>;
/**
 * Always return the first argument.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Instances
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import * as S from '@fp-tx/core/Semigroup'
 *
 * assert.deepStrictEqual(S.first<number>().concat(1, 2), 1)
 * ```
 *
 * @public
 */
export declare const first: <A = never>() => Semigroup<A>;
/**
 * Always return the last argument.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Instances
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @example
 *
 * ```typescript
 * import * as S from '@fp-tx/core/Semigroup'
 *
 * assert.deepStrictEqual(S.last<number>().concat(1, 2), 2)
 * ```
 *
 * @public
 */
export declare const last: <A = never>() => Semigroup<A>;
/**
 * Given a sequence of `as`, concat them and return the total.
 *
 * If `as` is empty, return the provided `startWith` 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/Semigroup'
 * import * as N from '@fp-tx/core/number'
 *
 * const sum = concatAll(N.SemigroupSum)(0)
 *
 * assert.deepStrictEqual(sum([1, 2, 3]), 6)
 * assert.deepStrictEqual(sum([]), 0)
 * ```
 *
 * @public
 */
export declare const concatAll: <A>(S: Semigroup<A>) => (startWith: A) => (as: ReadonlyArray<A>) => A;
/**
 * Use `void` module 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 semigroupVoid: Semigroup<void>;
/**
 * Use [`getAssignSemigroup`](./struct.ts.html#getAssignSemigroup) 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 getObjectSemigroup: <A extends object = never>() => Semigroup<A>;
/**
 * Use [`last`](#last) 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 getLastSemigroup: <A = never>() => Semigroup<A>;
/**
 * Use [`first`](#first) 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 getFirstSemigroup: <A = never>() => Semigroup<A>;
/**
 * 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 getTupleSemigroup: <T extends ReadonlyArray<Semigroup<any>>>(...semigroups: T) => Semigroup<{
    [K in keyof T]: T[K] extends 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 getStructSemigroup: <O extends ReadonlyRecord<string, any>>(semigroups: {
    [K in keyof O]: Semigroup<O[K]>;
}) => Semigroup<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 getDualSemigroup: <A>(S: Semigroup<A>) => Semigroup<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 getJoinSemigroup: <A>(O: Or.Ord<A>) => Semigroup<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 getMeetSemigroup: <A>(O: Or.Ord<A>) => Semigroup<A>;
/**
 * Use [`intercalate`](#intercalate) 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 getIntercalateSemigroup: <A>(middle: A) => (S: Semigroup<A>) => Semigroup<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 function fold<A>(S: Semigroup<A>): {
    (startWith: A): (as: ReadonlyArray<A>) => A;
    (startWith: A, as: ReadonlyArray<A>): A;
};
/**
 * Use [`SemigroupAll`](./boolean.ts.html#SemigroupAll) 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 semigroupAll: Semigroup<boolean>;
/**
 * Use [`SemigroupAny`](./boolean.ts.html#SemigroupAny) 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 semigroupAny: Semigroup<boolean>;
/**
 * Use [`getSemigroup`](./function.ts.html#getSemigroup) 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 getFunctionSemigroup: <S>(S: Semigroup<S>) => <A = never>() => Semigroup<(a: A) => S>;
/**
 * Use [`Semigroup`](./string.ts.html#Semigroup) 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 semigroupString: Semigroup<string>;
/**
 * Use [`SemigroupSum`](./number.ts.html#SemigroupSum) 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 semigroupSum: Semigroup<number>;
/**
 * Use [`SemigroupProduct`](./number.ts.html#SemigroupProduct) 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 semigroupProduct: Semigroup<number>;
//# sourceMappingURL=Semigroup.d.ts.map