import * as M from './Magma'
import * as Or from './Ord'
import { ReadonlyRecord } from './ReadonlyRecord'
import Ord = Or.Ord
import Magma = M.Magma
/**
* @category model
* @since 2.0.0
*/
export interface Semigroup extends Magma {}
/**
* Get a semigroup where `concat` will return the minimum, based on the provided order.
*
* @example
* import * as N from 'fp-ts/number'
* import * as S from 'fp-ts/Semigroup'
*
* const S1 = S.min(N.Ord)
*
* assert.deepStrictEqual(S1.concat(1, 2), 1)
*
* @category constructors
* @since 2.10.0
*/
export declare const min: (O: Or.Ord) => Semigroup
/**
* Get a semigroup where `concat` will return the maximum, based on the provided order.
*
* @example
* import * as N from 'fp-ts/number'
* import * as S from 'fp-ts/Semigroup'
*
* const S1 = S.max(N.Ord)
*
* assert.deepStrictEqual(S1.concat(1, 2), 2)
*
* @category constructors
* @since 2.10.0
*/
export declare const max: (O: Or.Ord) => Semigroup
/**
* @category constructors
* @since 2.10.0
*/
export declare const constant: (a: A) => Semigroup
/**
* The dual of a `Semigroup`, obtained by swapping the arguments of `concat`.
*
* @example
* import { reverse } from 'fp-ts/Semigroup'
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(reverse(S.Semigroup).concat('a', 'b'), 'ba')
*
* @since 2.10.0
*/
export declare const reverse: (S: Semigroup) => Semigroup
/**
* Given a struct of semigroups returns a semigroup for the struct.
*
* @example
* import { struct } from 'fp-ts/Semigroup'
* import * as N from 'fp-ts/number'
*
* interface Point {
* readonly x: number
* readonly y: number
* }
*
* const S = struct({
* x: N.SemigroupSum,
* y: N.SemigroupSum
* })
*
* assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })
*
* @since 2.10.0
*/
export declare const struct: (semigroups: { [K in keyof A]: Semigroup }) => Semigroup<{
readonly [K_1 in keyof A]: A[K_1]
}>
/**
* Given a tuple of semigroups returns a semigroup for the tuple.
*
* @example
* import { tuple } from 'fp-ts/Semigroup'
* import * as B from 'fp-ts/boolean'
* import * as N from 'fp-ts/number'
* import * as S from 'fp-ts/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])
*
* @since 2.10.0
*/
export declare const tuple: (
...semigroups: { [K in keyof A]: Semigroup }
) => Semigroup>
/**
* Between each pair of elements insert `middle`.
*
* @example
* import { intercalate } from 'fp-ts/Semigroup'
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* const S1 = pipe(S.Semigroup, intercalate(' + '))
*
* assert.strictEqual(S1.concat('a', 'b'), 'a + b')
*
* @since 2.10.0
*/
export declare const intercalate: (middle: A) => (S: Semigroup) => Semigroup
/**
* Always return the first argument.
*
* @example
* import * as S from 'fp-ts/Semigroup'
*
* assert.deepStrictEqual(S.first().concat(1, 2), 1)
*
* @category instances
* @since 2.10.0
*/
export declare const first: () => Semigroup
/**
* Always return the last argument.
*
* @example
* import * as S from 'fp-ts/Semigroup'
*
* assert.deepStrictEqual(S.last().concat(1, 2), 2)
*
* @category instances
* @since 2.10.0
*/
export declare const last: () => Semigroup
/**
* Given a sequence of `as`, concat them and return the total.
*
* If `as` is empty, return the provided `startWith` value.
*
* @example
* import { concatAll } from 'fp-ts/Semigroup'
* import * as N from 'fp-ts/number'
*
* const sum = concatAll(N.SemigroupSum)(0)
*
* assert.deepStrictEqual(sum([1, 2, 3]), 6)
* assert.deepStrictEqual(sum([]), 0)
*
* @since 2.10.0
*/
export declare const concatAll: (S: Semigroup) => (startWith: A) => (as: ReadonlyArray) => A
/**
* Use `void` module instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupVoid: Semigroup
/**
* Use [`getAssignSemigroup`](./struct.ts.html#getAssignSemigroup) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getObjectSemigroup: () => Semigroup
/**
* Use [`last`](#last) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getLastSemigroup: () => Semigroup
/**
* Use [`first`](#first) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getFirstSemigroup: () => Semigroup
/**
* Use [`tuple`](#tuple) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getTupleSemigroup: >>(
...semigroups: T
) => Semigroup<{
[K in keyof T]: T[K] extends Semigroup ? A : never
}>
/**
* Use [`struct`](#struct) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getStructSemigroup: >(semigroups: {
[K in keyof O]: Semigroup
}) => Semigroup
/**
* Use [`reverse`](#reverse) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getDualSemigroup: (S: Semigroup) => Semigroup
/**
* Use [`max`](#max) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getJoinSemigroup: (O: Or.Ord) => Semigroup
/**
* Use [`min`](#min) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getMeetSemigroup: (O: Or.Ord) => Semigroup
/**
* Use [`intercalate`](#intercalate) instead.
*
* @category zone of death
* @since 2.5.0
* @deprecated
*/
export declare const getIntercalateSemigroup: (middle: A) => (S: Semigroup) => Semigroup
/**
* Use [`concatAll`](#concatall) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare function fold(S: Semigroup): {
(startWith: A): (as: ReadonlyArray) => A
(startWith: A, as: ReadonlyArray): A
}
/**
* Use [`SemigroupAll`](./boolean.ts.html#SemigroupAll) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupAll: Semigroup
/**
* Use [`SemigroupAny`](./boolean.ts.html#SemigroupAny) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupAny: Semigroup
/**
* Use [`getSemigroup`](./function.ts.html#getSemigroup) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const getFunctionSemigroup: (S: Semigroup) => () => Semigroup<(a: A) => S>
/**
* Use [`Semigroup`](./string.ts.html#Semigroup) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupString: Semigroup
/**
* Use [`SemigroupSum`](./number.ts.html#SemigroupSum) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupSum: Semigroup
/**
* Use [`SemigroupProduct`](./number.ts.html#SemigroupProduct) instead.
*
* @category zone of death
* @since 2.0.0
* @deprecated
*/
export declare const semigroupProduct: Semigroup