{- |
Define common properties that can be used e.g. for automated tests.
Cf. to "Test.QuickCheck.Utils".
-}moduleAlgebra.Lawswherecommutative::Eqa=>(b->b->a)->b->b->Boolcommutativeopxy=x`op`y==y`op`xassociative::Eqa=>(a->a->a)->a->a->a->Boolassociativeopxyz=(x`op`y)`op`z==x`op`(y`op`z)leftIdentity::Eqa=>(b->a->a)->b->a->BoolleftIdentityopyx=y`op`x==xrightIdentity::Eqa=>(a->b->a)->b->a->BoolrightIdentityopyx=x`op`y==xidentity::Eqa=>(a->a->a)->a->a->Boolidentityopxy=leftIdentityopxy&&rightIdentityopxyleftZero::Eqa=>(a->a->a)->a->a->BoolleftZero=flip.rightIdentityrightZero::Eqa=>(a->a->a)->a->a->BoolrightZero=flip.leftIdentityzero::Eqa=>(a->a->a)->a->a->Boolzeroopxy=leftZeroopxy&&rightZeroopxyleftInverse::Eqa=>(b->b->a)->(b->b)->a->b->BoolleftInverseopinvyx=invx`op`x==yrightInverse::Eqa=>(b->b->a)->(b->b)->a->b->BoolrightInverseopinvyx=x`op`invx==yinverse::Eqa=>(b->b->a)->(b->b)->a->b->Boolinverseopinvyx=leftInverseopinvyx&&rightInverseopinvyxleftDistributive::Eqa=>(a->b->a)->(a->a->a)->b->a->a->BoolleftDistributive(#)opxyz=(y`op`z)#x==(y#x)`op`(z#x)rightDistributive::Eqa=>(b->a->a)->(a->a->a)->b->a->a->BoolrightDistributive(#)opxyz=x#(y`op`z)==(x#y)`op`(x#z)homomorphism::Eqa=>(b->a)->(b->b->b)->(a->a->a)->b->b->Boolhomomorphismfop0op1xy=f(x`op0`y)==fx`op1`fyrightCascade::Eqa=>(b->b->b)->(a->b->a)->a->b->b->BoolrightCascade(#)opxij=(x`op`i)`op`j==x`op`(i#j)leftCascade::Eqa=>(b->b->b)->(b->a->a)->a->b->b->BoolleftCascade(#)opxij=j`op`(i`op`x)==(j#i)`op`x