"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkSQA7G4TEjs = require('./chunk-SQA7G4TE.js');


var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/Eq.ts
var Eq_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, Eq_exports, {
  Contravariant: () => Contravariant,
  URI: () => URI,
  contramap: () => contramap,
  eq: () => eq,
  eqBoolean: () => eqBoolean,
  eqDate: () => eqDate,
  eqNumber: () => eqNumber,
  eqStrict: () => eqStrict,
  eqString: () => eqString,
  fromEquals: () => fromEquals,
  getMonoid: () => getMonoid,
  getSemigroup: () => getSemigroup,
  getStructEq: () => getStructEq,
  getTupleEq: () => getTupleEq,
  strictEqual: () => strictEqual,
  struct: () => struct,
  tuple: () => tuple
});
var fromEquals = (equals) => ({
  equals: (x, y) => x === y || equals(x, y)
});
var struct = (eqs) => fromEquals((first, second) => {
  for (const key in eqs) {
    if (!eqs[key].equals(first[key], second[key])) {
      return false;
    }
  }
  return true;
});
var tuple = (...eqs) => fromEquals((first, second) => eqs.every((E, i) => E.equals(first[i], second[i])));
var contramap_ = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, contramap(f));
var contramap = (f) => (fa) => fromEquals((x, y) => fa.equals(f(x), f(y)));
var URI = "Eq";
var eqStrict = {
  equals: (a, b) => a === b
};
var empty = {
  equals: () => true
};
var getSemigroup = () => ({
  concat: (x, y) => fromEquals((a, b) => x.equals(a, b) && y.equals(a, b))
});
var getMonoid = () => ({
  concat: getSemigroup().concat,
  empty
});
var Contravariant = {
  URI,
  contramap: contramap_
};
var getTupleEq = tuple;
var getStructEq = struct;
var strictEqual = eqStrict.equals;
var eq = Contravariant;
var eqBoolean = eqStrict;
var eqString = eqStrict;
var eqNumber = eqStrict;
var eqDate = {
  equals: (first, second) => first.valueOf() === second.valueOf()
};




















exports.fromEquals = fromEquals; exports.struct = struct; exports.tuple = tuple; exports.contramap = contramap; exports.URI = URI; exports.eqStrict = eqStrict; exports.getSemigroup = getSemigroup; exports.getMonoid = getMonoid; exports.Contravariant = Contravariant; exports.getTupleEq = getTupleEq; exports.getStructEq = getStructEq; exports.strictEqual = strictEqual; exports.eq = eq; exports.eqBoolean = eqBoolean; exports.eqString = eqString; exports.eqNumber = eqNumber; exports.eqDate = eqDate; exports.Eq_exports = Eq_exports;
