! {@      !"#$%&'()*+,-./0123456789:;<=>?None1FMXqquickcheck-classes-base*A set of laws associated with a typeclass.quickcheck-classes-base+Name of the typeclass whose laws are testedquickcheck-classes-basePairs of law name and propertyC@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NoneX .quickcheck-classes-baseTests 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 xNone>Xqquickcheck-classes-baseTests the following properties: From-To Inverse   "a To-From Inverse   "a Note:2 This property test is only available when using base-4.5 or newer.Note:  and . don't actually care about the type variable x in  a x , so here we instantiate it to '()'. by default. If you would like to instantiate x. as something else, please file a bug report.quickcheck-classes-baseTests the following properties: From-To Inverse   "a To-From Inverse   "a Note:2 This property test is only available when using base-4.9 or newer.None,HXqquickcheck-classes-base'Tests the following functor properties: Identity  "a  Composition (f  g) "a  f   gConst() "a  NoneSXq! quickcheck-classes-baseTests the following  properties: fold "a  foldMap f "a  ( . f) foldr f z t "a  ( ( . f) t ) zfoldr' f z0 xs "a let f' k x z = k  f x z in  f'  xs z0foldr1 f t "a let  (xs,x) =  ( t) in  f x xsfoldl f z t "a  ( ( ( .  .  f) t)) zfoldl' f z0 xs "a let f' x k z = k  f z x in  f'  xs z0foldl1 f t "a let x : xs =  t in  f x xstoList "a  (:) []null "a  ( ( )) length "a  .  ( ( 1))%Note that this checks to ensure that foldl' and foldr' are suitably strict.NoneX'v quickcheck-classes-baseTests the following properties:  Transitivea == b "' b == c ! a == c Symmetrica == b ! b == a Reflexivea == aSome 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.  NoneX2h quickcheck-classes-baseTests the following properties: Succ Pred Identity ( x) "a xPred Succ Identity ( x) "a xThis only works for Enum+ types that are not bounded, meaning that  and T must be total. This means that these property tests work correctly for types like  but not for .'Sadly, there is not a good way to test  and =, since many types that have reasonable implementations for  and  have more inhabitants than  does. quickcheck-classes-baseTests the same properties as  - except that it requires the type to have a u instance. These tests avoid taking the successor of the maximum element or the predecessor of the minimal element.  None,HXq4 quickcheck-classes-base-Tests the following contravariant properties: Identity  "a  Composition f   g "a  (g  f)  NoneXq< quickcheck-classes-baseTests the following  properties: Right Identityf   "a f Left Identity  f "a f Associativityf  (g  h) "a (f  g)  hNoteH: This property test is only available when this package is built with  base-4.9+ or transformers-0.5+.quickcheck-classes-baseTest everything from   plus the following:  Commutativef  g "a g  fNoteH: This property test is only available when this package is built with  base-4.9+ or transformers-0.5+.  NoneXLquickcheck-classes-baseTests 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 0Right RotationUno sign extension ! (rotateR n i "a (shiftR n i) .|. (shiftL n (finiteBitSize " - i))) Left RotationUno sign extension ! (rotateL n i "a (shiftL n i) .|. (shiftR n (finiteBitSize " - i)))Count Leading Zeros of Zero,countLeadingZeros zeroBits "a finiteBitSize "Count Trailing Zeros of Zero-countTrailingZeros zeroBits "a finiteBitSize "#All of the useful instances of the  typeclass also have L 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. NoneXqSquickcheck-classes-baseTests the following  properties:  Naturality (t  f) (t  g) "a t   f g& for every applicative transformation tIdentity   "a  Composition   ( g1 g2)   f1 f2 "a  (   g1 g2  f1) (   g2  f2)NoteH: This property test is only available when this package is built with  base-4.9+ or transformers-0.5+.NoneXqXquickcheck-classes-baseTests the following  properties: Identity   "a First Identity  "a Second Identity  "a Bifunctor Composition f g "a  f   g NoteH: This property test is only available when this package is built with  base-4.9+ or transformers-0.5+.NoneXqbquickcheck-classes-baseTests the following  properties: Bifold Identity "a    BifoldMap Identity f g "a  (  f) (  g) Bifoldr Identity f g z t "a  ( (  f) (  g) t) zNoteH: This property test is only available when this package is built with  base-4.10+ or transformers-0.5+.quickcheck-classes-baseTests the following 'Bifunctor'/'Bifoldable' properties: Bifold Identity f g "a    f gBifoldMap Identity f g   h i "a  (f  h) (g  i)NoteH: This property test is only available when this package is built with  base-4.10+ or transformers-0.5+.None >HSVXquickcheck-classes-baseTests 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.quickcheck-classes-baseProperty for the generate^ function, which builds a container of a given length by applying a function to each index.quickcheck-classes-baseProperty for the filterD function, which keeps elements for which the predicate holds true. quickcheck-classes-baseProperty for the filterM^ function, which keeps elements for which the predicate holds true in an applicative context.!quickcheck-classes-baseProperty for the mapMaybeD function, which keeps elements for which the predicate holds true.quickcheck-classes-baseinput element typequickcheck-classes-basefoldr functionquickcheck-classes-baseinput element typequickcheck-classes-basefoldl functionquickcheck-classes-baseinput element typequickcheck-classes-basemonadic foldl functionquickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-base map functionquickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-baseindexed map functionquickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-basemonadic indexed map functionquickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-basetraverse functionquickcheck-classes-baseinput element typequickcheck-classes-baseinput element typequickcheck-classes-baseinput element typequickcheck-classes-baseinput element typequickcheck-classes-base element typequickcheck-classes-base map function quickcheck-classes-base element typequickcheck-classes-basetraverse function!quickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-base map function"quickcheck-classes-baseinput element typequickcheck-classes-baseoutput element typequickcheck-classes-basetraverse function !" !"NoneXqj#quickcheck-classes-base+Tests the following applicative properties: Identity   v "a v Composition ()  u  v  w "a u  (v  w) Homomorphism f   x "a  (f x) Interchangeu   y "a  ( y)  u LiftA2 (1)() "a  #NoneXqa$quickcheck-classes-base+Tests the following alternative properties:  Left Identity  x "a xRight Identityx   "a x Associativitya  (b  c) "a (a  b)  c)$NoneX%quickcheck-classes-baseTests the various  properties:  (l,u) i   i ( (l,u)) (l,u)   (l,u) i  i, when  (l,u) i  ( (l,u)) ( (l,u))  [0 ..  (l,u) - 1]  (l,u)   ( (l,u))%NoneXql&quickcheck-classes-base'Tests the following monadic properties:  Left Identity a  k "a k aRight Identitym   "a m Associativitym  (\x -> k x  h) "a (m  k)  hReturn "a Ap() "a &NoneXq#quickcheck-classes-baseTests the following  properties:  Left Zero s  f "a  sNoneXq'quickcheck-classes-base*Tests the following monad plus properties:  Left Identity  x "a xRight Identity x  "a x Associativity a ( b c) "a  ( a b) c)  Left Zero  f "a  Right Zerom   "a 'NoneXqt(quickcheck-classes-base/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 .(NoneX)quickcheck-classes-baseTests 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*quickcheck-classes-baseTests the following properties:  Commutativemappend a b "a mappend b aJNote that this does not test associativity or identity. Make sure to use )! in addition to this set of laws.)*+NoneXR,quickcheck-classes-baseTests 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 0Additive Inverse a  a "a 0 Subtractiona   b "a a  b,NoneX-quickcheck-classes-baseTests 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-NoneXy.quickcheck-classes-baseTests the following properties:  Associativea  (b  c) "a (a  b)  c Concatenation as "a  () asTimes n a "a  () ( n a)/quickcheck-classes-baseTests the following properties:  Commutativea  b "a b  a>Note that this does not test associativity. Make sure to use .! in addition to this set of laws.0quickcheck-classes-baseTests the following properties:  Idempotenta  a "a a>Note that this does not test associativity. Make sure to use .] in addition to this set of laws. In literature, this class of semigroup is known as a band.1quickcheck-classes-baseTests the following properties: Rectangular Banda  b  a "a a>Note that this does not test associativity. Make sure to use .! in addition to this set of laws.2quickcheck-classes-baseTests the following properties:  Exponential n (a  b) "a  n a   n b>Note that this does not test associativity. Make sure to use .! in addition to this set of laws../012NoneX3quickcheck-classes-baseTests the following properties: Show a "a  0 a ""Equivariance:  p a r  s "a  p a (r  s)Equivariance:  as r  s "a  as (r  s)3NoneXɠ4quickcheck-classes-baseTests the following properties: Partial Isomorphism:  / @ ( a) "a  aPartial Isomorphism:  /  with initial space@ (" " ++  a) "a  aPartial Isomorphism:  / (a,"") `elem`  p ( p a "")Partial Isomorphism:  / (as,"") `elem`  ( as "")Partial Isomorphism:   / (as,"") `elem`  (  as "")Note: When using base-4.5% or older, a shim implementation of @ is used.4None FHVX̖5quickcheck-classes-base+Tests the following alternative properties: Set-Get( ptr ix a >>  ptr ix') "a  aGet-Set( ptr ix >>  ptr ix a) "a  a5NoneXqֳ6quickcheck-classes-baseTests the following  properties:  Naturalityt   f "a  (t  f)) for every applicative transformation tIdentity  "a  Composition (   g  f) "a    ( g)   fSequence Naturalityt   "a    t) for every applicative transformation tSequence Identity    "a Sequence Composition    "a      foldMap "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 ( x) "a  xDistributivity: t (x  y) "a t x  t y6NoneH7quickcheck-classes-baseLIn older versions of GHC, Proxy is not poly-kinded, so we provide Proxy2.9quickcheck-classes-baseLIn older versions of GHC, Proxy is not poly-kinded, so we provide Proxy1.;quickcheck-classes-baseMA 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.<quickcheck-classes-base[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.=quickcheck-classes-baseA 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 1. 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. HIn the case of a failing test, the program terminates with exit code 1.=quickcheck-classes-base/Element is type name paired with typeclass laws/ #$%&'()*+,-./0123456789:;<=/;=< ,%)*+- ./201345$# &'(6 9:78 !"#$%&' ( ) * + , - ./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUUVVWXYZ[\]^_`abbccdeefgghijjklmnnoopqrrsttuvwxyyzz{{||}~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_`_`\\\\\_`\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \ \] \ \ \\\ \\\\\\\\ _`!\"\#$%6quickcheck-classes-base-0.6.0.0-5pf9VlbcQd14eGe36P01OWTest.QuickCheck.Classes.Base#Test.QuickCheck.Classes.Base.IsList Test.QuickCheck.Classes.Internal Test.QuickCheck.Classes.IntegralTest.QuickCheck.Classes.GenericTest.QuickCheck.Classes.Functor Test.QuickCheck.Classes.FoldableTest.QuickCheck.Classes.EqTest.QuickCheck.Classes.Enum%Test.QuickCheck.Classes.Contravariant Test.QuickCheck.Classes.CategoryTest.QuickCheck.Classes.Bits%Test.QuickCheck.Classes.Bitraversable!Test.QuickCheck.Classes.Bifunctor"Test.QuickCheck.Classes.Bifoldable#Test.QuickCheck.Classes.Applicative#Test.QuickCheck.Classes.AlternativeTest.QuickCheck.Classes.IxTest.QuickCheck.Classes.Monad!Test.QuickCheck.Classes.MonadFail!Test.QuickCheck.Classes.MonadPlus Test.QuickCheck.Classes.MonadZipTest.QuickCheck.Classes.MonoidTest.QuickCheck.Classes.NumTest.QuickCheck.Classes.Ord!Test.QuickCheck.Classes.SemigroupTest.QuickCheck.Classes.Show Test.QuickCheck.Classes.ShowRead Test.QuickCheck.Classes.Storable#Test.QuickCheck.Classes.TraversableLaws lawsTypeclasslawsProperties integralLaws genericLaws generic1Laws functorLaws foldableLawseqLawsenumLawsboundedEnumLawscontravariantLaws categoryLawscommutativeCategoryLawsbitsLawsbitraversableLaws bifunctorLawsbifoldableLaws isListLaws foldrProp foldlProp foldlMPropmapPropimapProp imapMProp traverseProp generateProp generateMProp replicatePropreplicateMProp filterProp filterMProp mapMaybeProp mapMaybeMPropapplicativeLawsalternativeLawsixLaws monadLaws monadPlusLaws monadZipLaws monoidLawscommutativeMonoidLawssemigroupMonoidLawsnumLawsordLaws semigroupLawscommutativeSemigroupLawsidempotentSemigroupLawsrectangularBandSemigroupLawsexponentialSemigroupLawsshowLaws showReadLaws storableLawstraversableLawsProxy2Proxy1 lawsCheck lawsCheckOne lawsCheckMany$fMonoidStatus$fSemigroupStatusbase Text.Read readMaybeghc-prim GHC.TypesisTrue#ShowReadPrecedence VerySmallListgetVerySmallList SmallList getSmallListLinearEquationTwo_linearEquationTwoX_linearEquationTwoYQuadraticEquation_quadraticEquationQuadratic_quadraticEquationLinear_quadraticEquationConstantLinearEquationMLinearEquation_linearEquationLinear_linearEquationConstantApply2 getApply2ApplygetApplyBottomBottomUndefined BottomValue LastNothing ChooseFirst ChooseSecondTriplemyForAllShrink nestedEq1 propNestedEq1toSpecialApplicativeflipPairapTransfunc1func2func3func4func5func6 reverseTriplefoldMapArunLinearEquationrunLinearEquationMrunQuadraticEquationrunLinearEquationTwoeq1eq1_2eq2 GHC.GenericsfromGHC.Base.toidRepfrom1to1fmap<$const Data.FoldableFoldablefoldfoldMapfoldrmappendmemptyData.Semigroup.InternalappEndoEndofoldr'$!foldlfoldr1 GHC.MaybeJustunsnoctoListgetDualDualflipfoldl'foldl1nullFalseTruelengthgetSumSumGHC.Enumsuccpred integer-gmpGHC.Integer.TypeIntegerIntfromEnumtoEnumBoundedData.Functor.Contravariant contramapControl.CategoryCategory Data.BitsBits FiniteBitsData.Bitraversable Bitraversable bitraverseData.Functor.IdentityIdentityData.Functor.ComposeComposeData.Bifunctor BifunctorbimapfirstsecondData.Bifoldablebifold bifoldMapbifoldrbifoldableFunctorLawspure<*>$liftA2empty<|>GHC.ArrIxinRange GHC.Classes==elemrangeGHC.List!!indexmap rangeSizereturn>>=ap monadFailLawsControl.Monad.Fail MonadFailfailmplusmzero>>liftM Control.Arrow***Control.Monad.ZipmzipArrowGHC.Numnegate+-<>sconcatstimes replicateGHC.Showshow showsPrec++showListreadGHC.Read readsPrecreadList Text.Show showListWithshowsreadListDefaultForeign.Storable pokeElemOff peekElemOffData.Traversable Traversabletraverse sequenceAfoldMapDefault fmapDefault Applicative(QuickCheck-2.13.2-1FftnVviu6BCWJanU0jy5VTest.QuickCheck.Arbitrary ArbitraryOrderingMonoid Data.ProxyProxy