UNPKG

effect-ts-laws

Version:
11 lines 580 B
import { Law } from '#law'; import { defineConcreteLaws } from './given.js'; import { associativity } from '#algebra'; /** * Build typeclass laws for `Semigroup`. * @category typeclass laws */ export const semigroupLaws = ({ F, equalsA, a, suffix, }) => { return defineConcreteLaws('Semigroup', associativity({ a, f: F.combine, equals: equalsA }), Law('combineMany associativity', 'combineMany(a, [b, c]) = combine(a, combine(b, c))', a, a, a)((a, b, c) => equalsA(F.combineMany(a, [b, c]), F.combine(a, F.combine(b, c)))))(suffix); }; //# sourceMappingURL=Semigroup.js.map