úίl¤º2      !"#$%&'()*+,-./01Safe¸*A set of laws associated with a typeclass.+Name of the typeclass whose laws are testedPairs of law name and property623456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc 23456789:;<=>?@ABCDEFGHIJKLMNOPQSafeVÕTests the following properties: Conjunction Idempotence n .&. n "a nDisjunction Idempotence n .|. n "a nDouble Complementcomplement (complement n) "a nSet BitsetBit n i "a n .|. bit i Clear Bit'clearBit n i "a n .&. complement (bit i)Complement Bit!complementBit n i "a xor n (bit i) Clear ZeroclearBit zeroBits i "a zeroBitsSet ZerosetBit zeroBits i "a bit i Test ZerotestBit zeroBits i "a FalsePop ZeropopCount zeroBits "a 0Count Leading Zeros of Zero,countLeadingZeros zeroBits "a finiteBitSize "¥Count Trailing Zeros of Zero-countTrailingZeros zeroBits "a finiteBitSize "¥#All of the useful instances of the d typeclass also have eL instances, so these property tests actually require that instance as well.Note:2 This property test is only available when using base-4.7 or newer.fgSafeVaTests the following h properties: Identityi j j "a jFirst Identityk j "a jSecond Identityl j "a jBifunctor Compositioni f g "a k f m l g NoteH: This property test is only available when this package is built with  base-4.9+ or transformers-0.5+.SafeV$+Tests the following applicative properties: Identityn j o v "a v Compositionn (.) o u o v o w "a u o (v o w) Homomorphismn f o n x "a n (f x) Interchangeu o n y "a n (p y) o u LiftA2 (1)(o) "a q jSafeV|+Tests the following alternative properties: Identityr s x "a x x s r "a x Associativitya s (b s c) "a (a s b) s c)SafeV #Tests the following alt properties:  Associativity(a t b) t c "a a t (b t c)Left Distributivityf u (a t b) "a (f u a) t (f u b) NoneD Nv SafeV&H Tests the following properties:  Transitivea == b "' b == c !Ò a == c Symmetrica == b !Ò b == a Reflexivea == aûSome of these properties involve implication. In the case that the left hand side of the implication arrow does not hold, we do not retry. Consequently, these properties only end up being useful when the data type has a small number of inhabitants.  SafeV/f Tests the following w properties: foldx "a y jfoldMapy f "a z ({ . f) |foldrz f z t "a } (y (~ . f) t ) zfoldr' f z0 xs "a let f' k x z = k € f x z in  f' j xs z0foldr1‚ f t "a let ƒ (xs,x) = „ (… t) in z f x xsfoldl f z t "a } († (y (‡ . ~ . ˆ f) t)) zfoldl'‰ f z0 xs "a let f' x k z = k € f z x in z f' j xs z0foldl1Š f t "a let x : xs = … t in  f x xstoList… "a z (:) []null‹ "a z (Œ (Œ )) Žlength "a  . y (Œ (‘ 1))%Note that this checks to ensure that foldl' and foldr' are suitably strict.  SafeV1“ 'Tests the following functor properties: Identity’ j "a j Composition’ (f m g) "a ’ f m ’ gConst(“) "a ’ Œ  SafeV4¥ Tests the following properties: Quotient Remainder(quot x y) * y + (rem x y) "a xDivision Modulus(div x y) * y + (mod x y) "a xInteger RoundtripfromInteger (toInteger x) "a x None <FQTVIÏ Tests the following properties: Partial IsomorphismfromList . toList "a idLength Preservation&fromList xs "a fromListN (length xs) xsNote:2 This property test is only available when using base-4.7 or newer.Property for the generate^ function, which builds a container of a given length by applying a function to each index.Property for the filterD function, which keeps elements for which the predicate holds true.Property for the filterM^ function, which keeps elements for which the predicate holds true in an applicative context.Property for the mapMaybeD function, which keeps elements for which the predicate holds true.input element typefoldr functioninput element typefoldl functioninput element typemonadic foldl functioninput element typeoutput element type map functioninput element typeoutput element typeindexed map functioninput element typeoutput element typemonadic indexed map functioninput element typeoutput element typetraverse functioninput element typeinput element typeinput element typeinput element type element type map function element typetraverse functioninput element typeoutput element type map functioninput element typeoutput element typetraverse function  NoneVN9Tests the following properties: Partial Isomorphismdecode . encode "a JustEncoding Equals Valuedecode . encode "a Just . toJSON8Note that in the second property, the type of decode is ByteString -> Value, not ByteString -> aSafeVQO'Tests the following monadic properties:  Left Identity” a • k "a k aRight Identitym • ” "a m Associativitym • (\x -> k x • h) "a (m • k) • hReturnn "a ”Ap(o) "a –SafeVT”*Tests the following monad plus properties:  Left Identity— r x "a xRight Identity— x r "a x Associativity— a (— b c) "a — (— a b) c)  Left Zero˜ • f "a ˜ Right Zerom ™ ˜ "a ˜SafeVWê /Tests the following monadic zipping properties:  Naturalityš (f › g) (œ ma mb) = œ (š f ma) (š g mb)&In the laws above, the infix function ›" refers to a typeclass method of Arrow. SafeV\è!Tests the following properties:  Associative1mappend a (mappend b c) "a mappend (mappend a b) c Left Identitymappend mempty a "a aRight Identitymappend a mempty "a a Concatenation$mconcat as "a foldr mappend mempty as"Tests everything from ! plus the following:  Commutativemappend a b "a mappend b a!"žŸSafeV_B#Tests the following properties:  Antisymmetrya "d b "' b "d a !Ò a = b  Transitivitya "d b "' b "d c !Ò a "d cTotality a "d b "( a > b#None DFTVg$ Test that a   instance obey the several laws.¡destination pointer source arrayoffset into source arraynumber of prims to copy¢destination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copy£destination arrayoffset into destination array source arrayoffset into source arraynumber of bytes to copy¤ array to filloffset into arraynumber of values to fillvalue to fill with$¥¦§¨SafeViÈ%Tests the following properties:  Associativea © (b © c) "a (a © b) © c Concatenationª as "a ‚ (©) asTimes« n a "a ‚ (©) (replicate n a)%¬­®NoneVr%¯Tests the following properties: Additive Commutativity a + b "a b + aAdditive Left Identity 0 + a "a aAdditive Right Identity a + 0 "a aMultiplicative Associativitya * (b * c) "a (a * b) * cMultiplicative Left Identity 1 * a "a aMultiplicative Right Identity a * 1 "a a-Multiplication Left Distributes Over Additiona * (b + c) "a (a * b) + (a * c).Multiplication Right Distributes Over Addition(a + b) * c "a (a * c) + (b * c) Multiplicative Left Annihilation 0 * a "a 0!Multiplicative Right Annihilation a * 0 "a 0¯SafeVuM&Tests the following properties: Partial Isomorphism° (± a) == ƒ aNote: When using base-4.5, or older, this instead test the following: Partial Isomorphism² (± a) == a &None DFTVuÚ'SafeV“(Tests the following ³ properties:  Naturalityt m ´ f "a ´ (t m f)) for every applicative transformation tIdentity´ µ "a µ Composition´ (¶ m ’ g m f) "a ¶ m ’ (´ g) m ´ fSequence Naturalityt m · "a · m ’ t) for every applicative transformation tSequence Identity· m ’ µ "a µSequence Composition· m ’ ¶ "a ¶ m ’ · m ·foldMapy "a ¸fmap’ "a ¹ Where an applicative transformation is a function 1t :: (Applicative f, Applicative g) => f a -> g apreserving the º operations, i.e. Identity: t (n x) "a n xDistributivity: t (x o y) "a t x o t y(NoneF£)LIn older versions of GHC, Proxy is not poly-kinded, so we provide Proxy2.+LIn older versions of GHC, Proxy is not poly-kinded, so we provide Proxy1.-MA convenience function for testing properties in GHCi. For example, at GHCi:0lawsCheck (monoidLaws (Proxy :: Proxy Ordering))-Monoid: Associative +++ OK, passed 100 tests./Monoid: Left Identity +++ OK, passed 100 tests.0Monoid: Right Identity +++ OK, passed 100 tests.Assuming that the » instance for ¼+ is good, we now have confidence that the ½ instance for ¼ satisfies the monoid laws..[A convenience function that allows one to check many typeclass instances of the same type.GspecialisedLawsCheckMany (Proxy :: Proxy Word) [jsonLaws, showReadLaws]@ToJSON/FromJSON: Encoding Equals Value +++ OK, passed 100 tests.>ToJSON/FromJSON: Partial Isomorphism +++ OK, passed 100 tests.8Show/Read: Partial Isomorphism +++ OK, passed 100 tests./‚A convenience function for checking multiple typeclass instances of multiple types. Consider the following Haskell source file: Pimport Data.Proxy (Proxy(..)) import Data.Map (Map) import Data.Set (Set) -- A ¾ for Set ¿2. setInt :: Proxy (Set Int) setInt = Proxy -- A ¾ for Map ¿ ¿å. mapInt :: Proxy (Map Int Int) mapInt = Proxy myLaws :: Proxy a -> [Laws] myLaws p = [eqLaws p, monoidLaws p] namedTests :: [(String, [Laws])] namedTests = [ ("Set Int", myLaws setInt) , ("Map Int Int", myLaws mapInt) ]  Now, in GHCi:lawsCheckMany namedTests ÿýTesting properties for common typeclasses ------------- -- Set Int -- ------------- Eq: Transitive +++ OK, passed 100 tests. Eq: Symmetric +++ OK, passed 100 tests. Eq: Reflexive +++ OK, passed 100 tests. Monoid: Associative +++ OK, passed 100 tests. Monoid: Left Identity +++ OK, passed 100 tests. Monoid: Right Identity +++ OK, passed 100 tests. Monoid: Concatenation +++ OK, passed 100 tests. ----------------- -- Map Int Int -- ----------------- Eq: Transitive +++ OK, passed 100 tests. Eq: Symmetric +++ OK, passed 100 tests. Eq: Reflexive +++ OK, passed 100 tests. Monoid: Associative +++ OK, passed 100 tests. Monoid: Left Identity +++ OK, passed 100 tests. Monoid: Right Identity +++ OK, passed 100 tests. Monoid: Concatenation +++ OK, passed 100 tests. //Element is type name paired with typeclass laws!  !"#$%&'()*+,-./!-/." !#$%&'  (+,)*)*+,ÀÁÂà ! " # $ %&'()*+,-./0123456789:;<=>?@ABBCCDEFGHIIJKLLMNOPPQQRSTTUVVWXYZ[[\\]]^^_`abcdefghijklmnopqrsqrtuuqvwqvxqyzqv{qv|qy}qy~qyqy€qyqy‚qyƒ„…†q‡ˆ‰Š‹qŒqŒŽqŒqŒqy‘qy’q“”q“•qŒ–qy—qŒ˜qŒ™qyš ›qŒœq“q“žqyŸqŒ qŒ¡qŒ¢qy£‰Š¤‰Š¥qŒ¦q“§q“¨qy©qyªqy«qy¬qy­qy®qy¯qy°qy±q²³q´µ¶¶·¸¹º»¼½¾¿¿ÀÀqÁÂqÁÃqÁͶ·ÅqÆÇqÈÉqÆÊqËÌqËÍqÎÏqÐÑqËÒqËÓqËÔqyÕÖ×؉ŠÙqyÚqÛ܉ŠÝÞßàá0quickcheck-classes-0.4.12-7HZVtmxNpyOHoAd7hUMcHlTest.QuickCheck.ClassesTest.QuickCheck.Classes.IsListTest.QuickCheck.Classes.CommonTest.QuickCheck.Classes.Bits!Test.QuickCheck.Classes.Bifunctor#Test.QuickCheck.Classes.Applicative#Test.QuickCheck.Classes.AlternativeTest.QuickCheck.Classes.AltTest.QuickCheck.Classes.CompatTest.QuickCheck.Classes.Eq Test.QuickCheck.Classes.FoldableTest.QuickCheck.Classes.Functor Test.QuickCheck.Classes.IntegralTest.QuickCheck.Classes.JsonTest.QuickCheck.Classes.Monad!Test.QuickCheck.Classes.MonadPlus Test.QuickCheck.Classes.MonadZipTest.QuickCheck.Classes.MonoidTest.QuickCheck.Classes.OrdTest.QuickCheck.Classes.Prim!Test.QuickCheck.Classes.Semigroup Test.QuickCheck.Classes.Semiring Test.QuickCheck.Classes.ShowRead Test.QuickCheck.Classes.Storable#Test.QuickCheck.Classes.TraversableLaws lawsTypeclasslawsPropertiesbitsLaws bifunctorLawsapplicativeLawsalternativeLawsaltLawseqLaws foldableLaws functorLaws integralLaws isListLaws foldrProp foldlProp foldlMPropmapPropimapProp imapMProp traverseProp generateProp generateMProp replicatePropreplicateMProp filterProp filterMProp mapMaybeProp mapMaybeMPropjsonLaws monadLaws monadPlusLaws monadZipLaws monoidLawscommutativeMonoidLawsordLawsprimLaws semigroupLaws showReadLaws storableLawstraversableLawsProxy2Proxy1 lawsCheckspecialisedLawsCheckMany lawsCheckMany$fMonoidStatus$fSemigroupStatusLinearEquationTwo_linearEquationTwoX_linearEquationTwoYQuadraticEquation_quadraticEquationQuadratic_quadraticEquationLinear_quadraticEquationConstantLinearEquationMLinearEquation_linearEquationLinear_linearEquationConstantApply2 getApply2ApplygetApplyBottomBottomUndefined BottomValue LastNothing ChooseFirst ChooseSecondTriplemyForAllShrink nestedEq1 propNestedEq1toSpecialApplicativeflipPairapTransfunc1func2func3func4func5func6 reverseTriplefoldMapArunLinearEquationrunLinearEquationMrunQuadraticEquationrunLinearEquationTwobase Data.BitsBits FiniteBitsBitIndexData.Bifunctor BifunctorbimapGHC.Baseidfirstsecond.pure<*>$liftA2empty<|>*semigroupoids-5.2.2-FjW7hVXpHyqJ6IUkspUmftData.Functor.Alt Data.Functor<$>ghc-prim GHC.TypesisTrue# Data.FoldableFoldablefoldfoldMapfoldrmappendmempty Data.MonoidappEndoEndofoldr'$!foldlfoldr1JustunsnoctoListgetDualDualflipfoldl'foldl1nullconstFalseTruelengthgetSumSumfmap<$return>>=apmplusmzero>>liftM Control.Arrow***Control.Monad.Zipmzip SmallList getSmallList(primitive-0.6.2.0-EI3NK1Xfv9zEcRtyXK2EwZData.Primitive.TypesPrimcopyPrimArrayToPtrcopyMutablePrimArray copyPrimArray setPrimArrayMutablePrimArray PrimArrayData.Semigroup<>sconcatstimes semiringLaws Text.Read readMaybeGHC.ShowshowreadData.Traversable TraversabletraverseData.Functor.IdentityIdentityData.Functor.ComposeCompose sequenceAfoldMapDefault fmapDefault Applicative(QuickCheck-2.10.1-BUFYQzp5Pjm7JbQeTzW89lTest.QuickCheck.Arbitrary ArbitraryOrderingMonoid Data.ProxyProxyIntStatusBadGood