effect-ts-laws
Version:
effect-ts law testing using fast-check.
11 lines • 580 B
JavaScript
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