import { Semigroup } from 'fp-ts/Semigroup' ; import * as fc from 'fast-check' ; export const laws = { semigroup : { associativity : < A > ( S ) => ( a , b , c ) : boolean => S . concat ( S . concat ( a , b ) , c ) === S . concat ( a , S . concat ( b , c ) ) } } ; export const properties = { semigroup : { associativity : < A > ( S , arb ) => fc . property ( arb , arb , arb , laws . semigroup . associativity ( S ) ) } } ; import { Magma } from 'fp-ts/Magma' ; export const MagmaSub = { concat : ( x , y ) => x - y } ; fc . assert ( properties . semigroup . associativity ( MagmaSub , fc . integer ( ) ) ) ;