effect-ts-laws
Version:
effect-ts law testing using fast-check.
16 lines • 607 B
JavaScript
import { Law } from '#law';
import { Order as OD } from 'effect';
import { defineConcreteLaws } from './given.js';
/**
* Build typeclass laws for `Bounded`.
* @category typeclass laws
*/
export const boundedLaws = given => {
const { F, a, suffix } = given;
const [lte, gte] = [
OD.greaterThanOrEqualTo(F.compare),
OD.lessThanOrEqualTo(F.compare),
];
return defineConcreteLaws('Bounded', Law('lower bounded', 'a ≥ minBound ', a)(a => gte(a, F.minBound)), Law('upper bounded', 'a ≤ maxBound ', a)(a => lte(a, F.maxBound)))(suffix);
};
//# sourceMappingURL=Bounded.js.map