| Copyright | © 2022–2025 Jonathan Knowles | 
|---|---|
| License | Apache-2.0 | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Test.QuickCheck.Classes.Semigroup.Factorial
Description
This module provides Laws definitions for classes exported by
 Data.Semigroup.Factorial.
Synopsis
- factorialLaws :: (Arbitrary a, Show a, Eq a, Factorial a) => Proxy a -> Laws
 - stableFactorialLaws :: (Arbitrary a, Show a, Eq a, StableFactorial a) => Proxy a -> Laws
 
Documentation
factorialLaws :: (Arbitrary a, Show a, Eq a, Factorial a) => Proxy a -> Laws Source #
Laws for instances of Factorial.
Includes the following laws:
lengtha==Data.List.length(factorsa)
maybeasconcat(nonEmpty$factorsa)==amaybeasconcat(nonEmpty$reverse$factorsa)==reversea
all(\f ->factorsf==[f]) (factorsa)
primePrefixa==foldr(\x _ -> x) a aprimeSuffixa==foldl(\_ x -> x) a a
foldlf x a==Data.List.foldlf x (factorsa)foldl'f x a==Data.List.foldl'f x (factorsa)foldrf x a==Data.List.foldrf x (factorsa)
Note that the following superclass laws are not included:
stableFactorialLaws :: (Arbitrary a, Show a, Eq a, StableFactorial a) => Proxy a -> Laws Source #
Laws for instances of StableFactorial.
Includes the following laws:
factors(a<>b)==factorsa<>factorsb
factors(reversea)==Data.List.reverse(factorsa)
primePrefixa==primeSuffix(reversea)primeSuffixa==primePrefix(reversea)
Note that the following superclass laws are not included: