text: import { getEndomorphismMonoid as getEM, getMonoid } from './function';
  import * as _ from './internal';
  import * as Se from './Semigroup';
  // -------------------------------------------------------------------------------------
  // constructors
  // -------------------------------------------------------------------------------------
  /**
   * Get a monoid where `concat` will return the minimum, based on the provided bounded order.
   *
   * The `empty` value is the `top` value.
   *
   * @example
   * import * as N from 'fp-ts/number'
   * import * as M from 'fp-ts/Monoid'
   *
   * const M1 = M.min(N.Bounded)
   *
   * assert.deepStrictEqual(M1.concat(1, 2), 1)
   *
   * @category constructors
   * @since 2.10.0
   */
  export var min = function (B) { return ({
      concat: Se.min(B).concat,
      empty: B.top
  }); };
  /**
   * Get a monoid where `concat` will return the maximum, based on the provided bounded order.
   *
   * The `empty` value is the `bottom` value.
   *
   * @example
   * import * as N from 'fp-ts/number'
   * import * as M from 'fp-ts/Monoid'
   *
   * const M1 = M.max(N.Bounded)
   *
   * assert.deepStrictEqual(M1.concat(1, 2), 2)
   *
   * @category constructors
   * @since 2.10.0
   */
  export var max = function (B) { return ({
      concat: Se.max(B).concat,
      empty: B.bottom
  }); };
  // -------------------------------------------------------------------------------------
  // combinators
  // -------------------------------------------------------------------------------------
  /**
   * The dual of a `Monoid`, obtained by swapping the arguments of `concat`.
   *
   * @example
   * import { reverse } from 'fp-ts/Monoid'
   * import * as S from 'fp-ts/string'
   *
   * assert.deepStrictEqual(reverse(S.Monoid).concat('a', 'b'), 'ba')
   *
   * @category combinators
   * @since 2.10.0
   */
  export var reverse = function (M) { return ({
      concat: Se.reverse(M).concat,
      empty: M.empty
  }); };
  /**
   * Given a struct of monoids returns a monoid for the struct.
   *
   * @example
   * import { struct } from 'fp-ts/Monoid'
   * import * as N from 'fp-ts/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 })
   *
   * @category combinators
   * @since 2.10.0
   */
  export var struct = function (monoids) {
      var empty = {};
      for (var k in monoids) {
          if (_.has.call(monoids, k)) {
              empty[k] = monoids[k].empty;
          }
      }
      return {
          concat: Se.struct(monoids).concat,
          empty: empty
      };
  };
  /**
   * Given a tuple of monoids returns a monoid for the tuple.
   *
   * @example
   * import { tuple } from 'fp-ts/Monoid'
   * import * as B from 'fp-ts/boolean'
   * import * as N from 'fp-ts/number'
   * import * as S from 'fp-ts/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])
   *
   * @category combinators
   * @since 2.10.0
   */
  export var tuple = function () {
      var monoids = [];
      for (var _i = 0; _i < arguments.length; _i++) {
          monoids[_i] = arguments[_i];
      }
      return ({
          concat: Se.tuple.apply(Se, monoids).concat,
          empty: monoids.map(function (m) { return m.empty; })
      });
  };
  /**
   * @category instances
   * @since 2.0.0
   */
  export var monoidVoid = {
      concat: Se.semigroupVoid.concat,
      empty: undefined
  };
  // -------------------------------------------------------------------------------------
  // utils
  // -------------------------------------------------------------------------------------
  /**
   * Given a sequence of `as`, concat them and return the total.
   *
   * If `as` is empty, return the monoid `empty` value.
   *
   * @example
   * import { concatAll } from 'fp-ts/Monoid'
   * import * as N from 'fp-ts/number'
   *
   * assert.deepStrictEqual(concatAll(N.MonoidSum)([1, 2, 3]), 6)
   * assert.deepStrictEqual(concatAll(N.MonoidSum)([]), 0)
   *
   * @since 2.10.0
   */
  export var concatAll = function (M) { return Se.concatAll(M)(M.empty); };
  // -------------------------------------------------------------------------------------
  // deprecated
  // -------------------------------------------------------------------------------------
  /**
   * Use `tuple` instead.
   *
   * @category combinators
   * @since 2.0.0
   * @deprecated
   */
  export var getTupleMonoid = tuple;
  /**
   * Use `struct` instead.
   *
   * @category combinators
   * @since 2.0.0
   * @deprecated
   */
  export var getStructMonoid = struct;
  /**
   * Use `reverse` instead.
   *
   * @category combinators
   * @since 2.0.0
   * @deprecated
   */
  export var getDualMonoid = reverse;
  /**
   * Use `max` instead.
   *
   * @category constructors
   * @since 2.0.0
   * @deprecated
   */
  export var getJoinMonoid = max;
  /**
   * Use `min` instead.
   *
   * @category constructors
   * @since 2.0.0
   * @deprecated
   */
  export var getMeetMonoid = min;
  /**
   * Use `concatAll` instead.
   *
   * @since 2.0.0
   * @deprecated
   */
  export var fold = concatAll;
  /**
   * Use `boolean.MonoidAll` instead.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var monoidAll = {
      // tslint:disable-next-line: deprecation
      concat: Se.semigroupAll.concat,
      empty: true
  };
  /**
   * Use `boolean.MonoidAny` instead.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var monoidAny = {
      // tslint:disable-next-line: deprecation
      concat: Se.semigroupAny.concat,
      empty: false
  };
  /**
   * Use `function.getMonoid` instead.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var getFunctionMonoid = getMonoid;
  /**
   * Use `function.getEndomorphismMonoid` instead.
   *
   * **Note**. The execution order in `function.getEndomorphismMonoid` is reversed.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var getEndomorphismMonoid = function () { return reverse(getEM()); };
  /**
   * Use `string.Monoid` instead.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var monoidString = {
      // tslint:disable-next-line: deprecation
      concat: Se.semigroupString.concat,
      empty: ''
  };
  /**
   * Use `number.MonoidSum` instead.
   *
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var monoidSum = {
      // tslint:disable-next-line: deprecation
      concat: Se.semigroupSum.concat,
      empty: 0
  };
  /**
   * @category instances
   * @since 2.0.0
   * @deprecated
   */
  export var monoidProduct = {
      // tslint:disable-next-line: deprecation
      concat: Se.semigroupProduct.concat,
      empty: 1
  };
  