Module
Test.QuickCheck.Laws.Data
- Package
- purescript-quickcheck-laws
- Repository
- garyb/purescript-quickcheck-laws
Re-exports from Test.QuickCheck.Laws.Data.BooleanAlgebra
#checkBooleanAlgebra Source
checkBooleanAlgebra :: forall a eff. Arbitrary a => BooleanAlgebra a => Eq a => Proxy a -> QC eff Unit
- Excluded middle:
a || not a = tt
Re-exports from Test.QuickCheck.Laws.Data.Bounded
Re-exports from Test.QuickCheck.Laws.Data.BoundedEnum
#checkBoundedEnum Source
checkBoundedEnum :: forall a eff. Arbitrary a => BoundedEnum a => Ord a => Proxy a -> QC eff Unit
- succ:
succ bottom >>= succ >>= succ ... succ [cardinality - 1 times] = top
- pred:
pred top >>= pred >>= pred ... pred [cardinality - 1 times] = bottom
- predsucc:
forall a > bottom: pred a >>= succ = Just a
- succpred:
forall a < top: succ a >>= pred = Just a
- enumpred:
forall a > bottom: fromEnum <$> pred a = Just (fromEnum a - 1)
- enumsucc:
forall a < top: fromEnum <$> succ a = Just (fromEnum a + 1)
- compare:
compare e1 e2 = compare (fromEnum e1) (fromEnum e2)
- tofromenum: toEnum (fromEnum a) = Just a
Re-exports from Test.QuickCheck.Laws.Data.CommutativeRing
#checkCommutativeRing Source
checkCommutativeRing :: forall a eff. CommutativeRing a => Arbitrary a => Eq a => Proxy a -> QC eff Unit
- Commutative multiplication:
a * b = b * a
Re-exports from Test.QuickCheck.Laws.Data.Eq
Re-exports from Test.QuickCheck.Laws.Data.EuclideanRing
#checkEuclideanRing Source
checkEuclideanRing :: forall a eff. EuclideanRing a => Arbitrary a => Eq a => Proxy a -> QC eff Unit
- Integral domain:
a /= 0
andb /= 0
impliesa * b /= 0
- Multiplicative Euclidean function:
a = (a / b) * b + (a `mod` b)
wheredegree a > 0
anddegree a <= degree (a * b)
Re-exports from Test.QuickCheck.Laws.Data.Field
Re-exports from Test.QuickCheck.Laws.Data.Foldable
Re-exports from Test.QuickCheck.Laws.Data.Functor
Re-exports from Test.QuickCheck.Laws.Data.HeytingAlgebra
#checkHeytingAlgebra Source
checkHeytingAlgebra :: forall a eff. Arbitrary a => HeytingAlgebra a => Eq a => Proxy a -> QC eff Unit
- Associativity:
a || (b || c) = (a || b) || c
a && (b && c) = (a && b) && c
- Commutativity:
a || b = b || a
a && b = b && a
- Absorption:
a || (a && b) = a
a && (a || b) = a
- Idempotent:
a || a = a
a && a = a
- Identity:
a || ff = a
a && tt = a
- Implication:
a `implies` a = tt
a && (a `implies` b) = a && b
b && (a `implies` b) = b
a `implies` (b && c) = (a `implies` b) && (a `implies` c)
- Complemented:
not a = a `implies` ff
Re-exports from Test.QuickCheck.Laws.Data.Monoid
Re-exports from Test.QuickCheck.Laws.Data.Ord
Re-exports from Test.QuickCheck.Laws.Data.Ring
Re-exports from Test.QuickCheck.Laws.Data.Semigroup
Re-exports from Test.QuickCheck.Laws.Data.Semiring
#checkSemiring Source
checkSemiring :: forall a eff. Semiring a => Arbitrary a => Eq a => Proxy a -> QC eff Unit
- Commutative monoid under addition:
- Associativity:
(a + b) + c = a + (b + c)
- Identity:
zero + a = a + zero = a
- Commutative:
a + b = b + a
- Associativity:
- Monoid under multiplication:
- Associativity:
(a * b) * c = a * (b * c)
- Identity:
one * a = a * one = a
- Associativity:
- Multiplication distributes over addition:
- Left distributivity:
a * (b + c) = (a * b) + (a * c)
- Right distributivity:
(a + b) * c = (a * c) + (b * c)
- Left distributivity:
- Annihiliation:
zero * a = a * zero = zero
- Modules
- Test.
QuickCheck. Laws - Test.
QuickCheck. Laws. Control - Test.
QuickCheck. Laws. Control. Alt - Test.
QuickCheck. Laws. Control. Alternative - Test.
QuickCheck. Laws. Control. Applicative - Test.
QuickCheck. Laws. Control. Apply - Test.
QuickCheck. Laws. Control. Bind - Test.
QuickCheck. Laws. Control. Category - Test.
QuickCheck. Laws. Control. Comonad - Test.
QuickCheck. Laws. Control. Extend - Test.
QuickCheck. Laws. Control. Monad - Test.
QuickCheck. Laws. Control. MonadPlus - Test.
QuickCheck. Laws. Control. MonadZero - Test.
QuickCheck. Laws. Control. Plus - Test.
QuickCheck. Laws. Control. Semigroupoid - Test.
QuickCheck. Laws. Data - Test.
QuickCheck. Laws. Data. BooleanAlgebra - Test.
QuickCheck. Laws. Data. Bounded - Test.
QuickCheck. Laws. Data. BoundedEnum - Test.
QuickCheck. Laws. Data. CommutativeRing - Test.
QuickCheck. Laws. Data. Eq - Test.
QuickCheck. Laws. Data. EuclideanRing - Test.
QuickCheck. Laws. Data. Field - Test.
QuickCheck. Laws. Data. Foldable - Test.
QuickCheck. Laws. Data. Functor - Test.
QuickCheck. Laws. Data. HeytingAlgebra - Test.
QuickCheck. Laws. Data. Monoid - Test.
QuickCheck. Laws. Data. Ord - Test.
QuickCheck. Laws. Data. Ring - Test.
QuickCheck. Laws. Data. Semigroup - Test.
QuickCheck. Laws. Data. Semiring