-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | QuickCheck common typeclasses
--   
--   This library provides QuickCheck properties to ensure that typeclass
--   instances adhere to the set of laws that they are supposed to. There
--   are other libraries that do similar things, such as
--   `genvalidity-hspec` and <a>checkers</a>. This library differs from
--   other solutions by not introducing any new typeclasses that the user
--   needs to learn.
@package quickcheck-classes
@version 0.4.12


-- | This module provides property tests for functions that operate on
--   list-like data types. If your data type is fully polymorphic in its
--   element type, is it recommended that you use <tt>foldableLaws</tt> and
--   <tt>traversableLaws</tt> from <tt>Test.QuickCheck.Classes</tt>.
--   However, if your list-like data type is either monomorphic in its
--   element type (like <tt>Text</tt> or <tt>ByteString</tt>) or if it
--   requires a typeclass constraint on its element (like
--   <tt>Data.Vector.Unboxed</tt>), the properties provided here can be
--   helpful for testing that your functions have the expected behavior.
--   All properties in this module require your data type to have an
--   <a>IsList</a> instance.
module Test.QuickCheck.Classes.IsList

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Partial Isomorphism</i></i> <tt>fromList . toList ≡
--   id</tt></li>
--   <li><i><i>Length Preservation</i></i> <tt>fromList xs ≡ fromListN
--   (length xs) xs</tt></li>
--   </ul>
--   
--   <i>Note:</i> This property test is only available when using
--   <tt>base-4.7</tt> or newer.
isListLaws :: (IsList a, Show a, Show (Item a), Arbitrary a, Arbitrary (Item a), Eq a) => Proxy a -> Laws
foldrProp :: (IsList c, Item c ~ a, Arbitrary c, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> (forall b. (a -> b -> b) -> b -> c -> b) -> Property
foldlProp :: (IsList c, Item c ~ a, Arbitrary c, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> (forall b. (b -> a -> b) -> b -> c -> b) -> Property
foldlMProp :: (IsList c, Item c ~ a, Arbitrary c, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> (forall s b. (b -> a -> ST s b) -> b -> c -> ST s b) -> Property
mapProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> ((a -> b) -> c -> d) -> Property
imapProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> ((Int -> a -> b) -> c -> d) -> Property
imapMProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> (forall s. (Int -> a -> ST s b) -> c -> ST s d) -> Property
traverseProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> (forall s. (a -> ST s b) -> c -> ST s d) -> Property

-- | Property for the <tt>generate</tt> function, which builds a container
--   of a given length by applying a function to each index.
generateProp :: (Item c ~ a, Eq c, Show c, IsList c, Arbitrary a, Show a) => Proxy a -> (Int -> (Int -> a) -> c) -> Property
generateMProp :: (Item c ~ a, Eq c, Show c, IsList c, Arbitrary a, Show a) => Proxy a -> (forall s. Int -> (Int -> ST s a) -> ST s c) -> Property
replicateProp :: (Item c ~ a, Eq c, Show c, IsList c, Arbitrary a, Show a) => Proxy a -> (Int -> a -> c) -> Property
replicateMProp :: (Item c ~ a, Eq c, Show c, IsList c, Arbitrary a, Show a) => Proxy a -> (forall s. Int -> ST s a -> ST s c) -> Property

-- | Property for the <tt>filter</tt> function, which keeps elements for
--   which the predicate holds true.
filterProp :: (IsList c, Item c ~ a, Arbitrary c, Show c, Show a, Eq c, CoArbitrary a, Function a) => Proxy a -> ((a -> Bool) -> c -> c) -> Property

-- | Property for the <tt>filterM</tt> function, which keeps elements for
--   which the predicate holds true in an applicative context.
filterMProp :: (IsList c, Item c ~ a, Arbitrary c, Show c, Show a, Eq c, CoArbitrary a, Function a) => Proxy a -> (forall s. (a -> ST s Bool) -> c -> ST s c) -> Property

-- | Property for the <tt>mapMaybe</tt> function, which keeps elements for
--   which the predicate holds true.
mapMaybeProp :: (IsList c, Item c ~ a, Item d ~ b, Eq d, IsList d, Arbitrary b, Show d, Show b, Arbitrary c, Show c, Show a, Eq c, CoArbitrary a, Function a) => Proxy a -> Proxy b -> ((a -> Maybe b) -> c -> d) -> Property
mapMaybeMProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> (forall s. (a -> ST s (Maybe b)) -> c -> ST s d) -> Property


-- | This library provides sets of properties that should hold for common
--   typeclasses.
module Test.QuickCheck.Classes

-- | A convenience function for testing properties in GHCi. For example, at
--   GHCi:
--   
--   <pre>
--   &gt;&gt;&gt; lawsCheck (monoidLaws (Proxy :: Proxy Ordering))
--   Monoid: Associative +++ OK, passed 100 tests.
--   Monoid: Left Identity +++ OK, passed 100 tests.
--   Monoid: Right Identity +++ OK, passed 100 tests.
--   </pre>
--   
--   Assuming that the <a>Arbitrary</a> instance for <a>Ordering</a> is
--   good, we now have confidence that the <a>Monoid</a> instance for
--   <a>Ordering</a> satisfies the monoid laws.
lawsCheck :: Laws -> IO ()

-- | A convenience function for checking multiple typeclass instances of
--   multiple types. Consider the following Haskell source file:
--   
--   <pre>
--   import Data.Proxy (Proxy(..))
--   import Data.Map (Map)
--   import Data.Set (Set)
--   
--   -- A <a>Proxy</a> for <tt>Set</tt> <a>Int</a>. 
--   setInt :: Proxy (Set Int)
--   setInt = Proxy
--   
--   -- A <a>Proxy</a> for <tt>Map</tt> <a>Int</a> <a>Int</a>.
--   mapInt :: Proxy (Map Int Int)
--   mapInt = Proxy
--   
--   myLaws :: Proxy a -&gt; [Laws]
--   myLaws p = [eqLaws p, monoidLaws p]
--   
--   namedTests :: [(String, [Laws])]
--   namedTests =
--     [ ("Set Int", myLaws setInt)
--     , ("Map Int Int", myLaws mapInt)
--     ]
--   </pre>
--   
--   Now, in GHCi:
--   
--   <pre>
--   &gt;&gt;&gt; lawsCheckMany namedTests
--   </pre>
--   
--   <pre>
--   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.
--   </pre>
lawsCheckMany :: [(String, [Laws])] -> IO ()

-- | A convenience function that allows one to check many typeclass
--   instances of the same type.
--   
--   <pre>
--   &gt;&gt;&gt; specialisedLawsCheckMany (Proxy :: Proxy Word) [jsonLaws, showReadLaws]
--   ToJSON/FromJSON: Encoding Equals Value +++ OK, passed 100 tests.
--   ToJSON/FromJSON: Partial Isomorphism +++ OK, passed 100 tests.
--   Show/Read: Partial Isomorphism +++ OK, passed 100 tests.
--   </pre>
specialisedLawsCheckMany :: Proxy a -> [Proxy a -> Laws] -> IO ()

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Conjunction Idempotence</i></i> <tt>n .&amp;. n ≡
--   n</tt></li>
--   <li><i><i>Disjunction Idempotence</i></i> <tt>n .|. n ≡ n</tt></li>
--   <li><i><i>Double Complement</i></i> <tt>complement (complement n) ≡
--   n</tt></li>
--   <li><i><i>Set Bit</i></i> <tt>setBit n i ≡ n .|. bit i</tt></li>
--   <li><i><i>Clear Bit</i></i> <tt>clearBit n i ≡ n .&amp;. complement
--   (bit i)</tt></li>
--   <li><i><i>Complement Bit</i></i> <tt>complementBit n i ≡ xor n (bit
--   i)</tt></li>
--   <li><i><i>Clear Zero</i></i> <tt>clearBit zeroBits i ≡
--   zeroBits</tt></li>
--   <li><i><i>Set Zero</i></i> <tt>setBit zeroBits i ≡ bit i</tt></li>
--   <li><i><i>Test Zero</i></i> <tt>testBit zeroBits i ≡ False</tt></li>
--   <li><i><i>Pop Zero</i></i> <tt>popCount zeroBits ≡ 0</tt></li>
--   <li><i><i>Count Leading Zeros of Zero</i></i> <tt>countLeadingZeros
--   zeroBits ≡ finiteBitSize ⊥</tt></li>
--   <li><i><i>Count Trailing Zeros of Zero</i></i> <tt>countTrailingZeros
--   zeroBits ≡ finiteBitSize ⊥</tt></li>
--   </ul>
--   
--   All of the useful instances of the <a>Bits</a> typeclass also have
--   <a>FiniteBits</a> instances, so these property tests actually require
--   that instance as well.
--   
--   <i>Note:</i> This property test is only available when using
--   <tt>base-4.7</tt> or newer.
bitsLaws :: (FiniteBits a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests everything from <a>monoidLaws</a> plus the following:
--   
--   <ul>
--   <li><i><i>Commutative</i></i> <tt>mappend a b ≡ mappend b a</tt></li>
--   </ul>
commutativeMonoidLaws :: (Monoid a, Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Transitive</i></i> <tt>a == b ∧ b == c ⇒ a == c</tt></li>
--   <li><i><i>Symmetric</i></i> <tt>a == b ⇒ b == a</tt></li>
--   <li><i><i>Reflexive</i></i> <tt>a == a</tt></li>
--   </ul>
--   
--   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.
eqLaws :: (Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Quotient Remainder</i></i> <tt>(quot x y) * y + (rem x y) ≡
--   x</tt></li>
--   <li><i><i>Division Modulus</i></i> <tt>(div x y) * y + (mod x y) ≡
--   x</tt></li>
--   <li><i><i>Integer Roundtrip</i></i> <tt>fromInteger (toInteger x) ≡
--   x</tt></li>
--   </ul>
integralLaws :: (Integral a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Partial Isomorphism</i></i> <tt>fromList . toList ≡
--   id</tt></li>
--   <li><i><i>Length Preservation</i></i> <tt>fromList xs ≡ fromListN
--   (length xs) xs</tt></li>
--   </ul>
--   
--   <i>Note:</i> This property test is only available when using
--   <tt>base-4.7</tt> or newer.
isListLaws :: (IsList a, Show a, Show (Item a), Arbitrary a, Arbitrary (Item a), Eq a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Partial Isomorphism</i></i> <tt>decode . encode ≡
--   Just</tt></li>
--   <li><i><i>Encoding Equals Value</i></i> <tt>decode . encode ≡ Just .
--   toJSON</tt></li>
--   </ul>
--   
--   Note that in the second property, the type of decode is <tt>ByteString
--   -&gt; Value</tt>, not <tt>ByteString -&gt; a</tt>
jsonLaws :: (ToJSON a, FromJSON a, Show a, Arbitrary a, Eq a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Associative</i></i> <tt>mappend a (mappend b c) ≡ mappend
--   (mappend a b) c</tt></li>
--   <li><i><i>Left Identity</i></i> <tt>mappend mempty a ≡ a</tt></li>
--   <li><i><i>Right Identity</i></i> <tt>mappend a mempty ≡ a</tt></li>
--   <li><i><i>Concatenation</i></i> <tt>mconcat as ≡ foldr mappend mempty
--   as</tt></li>
--   </ul>
monoidLaws :: (Monoid a, Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Antisymmetry</i></i> <tt>a ≤ b ∧ b ≤ a ⇒ a = b</tt></li>
--   <li><i><i>Transitivity</i></i> <tt>a ≤ b ∧ b ≤ c ⇒ a ≤ c</tt></li>
--   <li><i><i>Totality</i></i> <tt>a ≤ b ∨ a &gt; b</tt></li>
--   </ul>
ordLaws :: (Ord a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Test that a <a>Prim</a> instance obey the several laws.
primLaws :: (Prim a, Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Associative</i></i> <tt>a <a>&lt;&gt;</a> (b <a>&lt;&gt;</a>
--   c) ≡ (a <a>&lt;&gt;</a> b) <a>&lt;&gt;</a> c</tt></li>
--   <li><i><i>Concatenation</i></i> <tt><a>sconcat</a> as ≡ <a>foldr1</a>
--   (<a>&lt;&gt;</a>) as</tt></li>
--   <li><i><i>Times</i></i> <tt><a>stimes</a> n a ≡ <a>foldr1</a>
--   (<a>&lt;&gt;</a>) (replicate n a)</tt></li>
--   </ul>
semigroupLaws :: (Semigroup a, Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following properties:
--   
--   <ul>
--   <li><i><i>Partial Isomorphism</i></i> <tt><a>readMaybe</a>
--   (<a>show</a> a) == <a>Just</a> a</tt></li>
--   </ul>
--   
--   <i>Note:</i> When using <tt>base-4.5</tt> or older, this instead test
--   the following:
--   
--   <ul>
--   <li><i><i>Partial Isomorphism</i></i> <tt><a>read</a> (<a>show</a> a)
--   == a</tt></li>
--   </ul>
showReadLaws :: (Show a, Read a, Eq a, Arbitrary a) => Proxy a -> Laws
storableLaws :: (Storable a, Eq a, Arbitrary a, Show a) => Proxy a -> Laws

-- | Tests the following alternative properties:
--   
--   <ul>
--   <li><i><i>Identity</i></i> <tt><a>empty</a> <a>&lt;|&gt;</a> x ≡
--   x</tt> <tt>x <a>&lt;|&gt;</a> <a>empty</a> ≡ x</tt></li>
--   <li><i><i>Associativity</i></i> <tt>a <a>&lt;|&gt;</a> (b
--   <a>&lt;|&gt;</a> c) ≡ (a <a>&lt;|&gt;</a> b) <a>&lt;|&gt;</a>
--   c)</tt></li>
--   </ul>
alternativeLaws :: (Alternative f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following alt properties:
--   
--   <ul>
--   <li><i><i>Associativity</i></i> <tt>(a <a>&lt;!&gt;</a> b)
--   <a>&lt;!&gt;</a> c ≡ a <a>&lt;!&gt;</a> (b <a>&lt;!&gt;</a>
--   c)</tt></li>
--   <li><i><i>Left Distributivity</i></i> <tt>f <a>&lt;$&gt;</a> (a
--   <a>&lt;!&gt;</a> b) ≡ (f <a>&lt;$&gt;</a> a) <a>&lt;!&gt;</a> (f
--   <a>&lt;$&gt;</a> b)</tt></li>
--   </ul>
altLaws :: (Alt f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following applicative properties:
--   
--   <ul>
--   <li><i><i>Identity</i></i> <tt><a>pure</a> <a>id</a> <a>&lt;*&gt;</a>
--   v ≡ v</tt></li>
--   <li><i><i>Composition</i></i> <tt><a>pure</a> (.) <a>&lt;*&gt;</a> u
--   <a>&lt;*&gt;</a> v <a>&lt;*&gt;</a> w ≡ u <a>&lt;*&gt;</a> (v
--   <a>&lt;*&gt;</a> w)</tt></li>
--   <li><i><i>Homomorphism</i></i> <tt><a>pure</a> f <a>&lt;*&gt;</a>
--   <a>pure</a> x ≡ <a>pure</a> (f x)</tt></li>
--   <li><i><i>Interchange</i></i> <tt>u <a>&lt;*&gt;</a> <a>pure</a> y ≡
--   <a>pure</a> (<a>$</a> y) <a>&lt;*&gt;</a> u</tt></li>
--   <li><i><i>LiftA2 (1)</i></i> <tt>(<a>&lt;*&gt;</a>) ≡ <a>liftA2</a>
--   <a>id</a></tt></li>
--   </ul>
applicativeLaws :: (Applicative f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following <a>Bifunctor</a> properties:
--   
--   <ul>
--   <li><i><i>Identity</i></i> <tt><a>bimap</a> <a>id</a> <a>id</a> ≡
--   <a>id</a></tt></li>
--   <li><i><i>First Identity</i></i> <tt><a>first</a> <a>id</a> ≡
--   <a>id</a></tt></li>
--   <li><i><i>Second Identity</i></i> <tt><a>second</a> <a>id</a> ≡
--   <a>id</a></tt></li>
--   <li><i><i>Bifunctor Composition</i></i> <tt><a>bimap</a> f g ≡
--   <a>first</a> f <a>.</a> <a>second</a> g</tt></li>
--   </ul>
--   
--   <i>Note</i>: This property test is only available when this package is
--   built with <tt>base-4.9+</tt> or <tt>transformers-0.5+</tt>.
bifunctorLaws :: (Bifunctor f, Eq2 f, Show2 f, Arbitrary2 f) => proxy f -> Laws

-- | Tests the following <a>Foldable</a> properties:
--   
--   <ul>
--   <li><i><i>fold</i></i> <tt><a>fold</a> ≡ <a>foldMap</a>
--   <a>id</a></tt></li>
--   <li><i><i>foldMap</i></i> <tt><a>foldMap</a> f ≡ <a>foldr</a>
--   (<a>mappend</a> . f) <a>mempty</a></tt></li>
--   <li><i><i>foldr</i></i> <tt><a>foldr</a> f z t ≡ <a>appEndo</a>
--   (<a>foldMap</a> (<a>Endo</a> . f) t ) z</tt></li>
--   <li><i><i>foldr'</i></i> <tt><a>foldr'</a> f z0 xs ≡ let f' k x z = k
--   <a>$!</a> f x z in <a>foldl</a> f' <a>id</a> xs z0</tt></li>
--   <li><i><i>foldr1</i></i> <tt><a>foldr1</a> f t ≡ let <a>Just</a>
--   (xs,x) = <a>unsnoc</a> (<a>toList</a> t) in <a>foldr</a> f x
--   xs</tt></li>
--   <li><i><i>foldl</i></i> <tt><a>foldl</a> f z t ≡ <a>appEndo</a>
--   (<a>getDual</a> (<a>foldMap</a> (<a>Dual</a> . <a>Endo</a> .
--   <a>flip</a> f) t)) z</tt></li>
--   <li><i><i>foldl'</i></i> <tt><a>foldl'</a> f z0 xs ≡ let f' x k z = k
--   <a>$!</a> f z x in <a>foldr</a> f' <a>id</a> xs z0</tt></li>
--   <li><i><i>foldl1</i></i> <tt><a>foldl1</a> f t ≡ let x : xs =
--   <a>toList</a> t in <a>foldl</a> f x xs</tt></li>
--   <li><i><i>toList</i></i> <tt><a>toList</a> ≡ <a>foldr</a> (:)
--   []</tt></li>
--   <li><i><i>null</i></i> <tt><a>null</a> ≡ <a>foldr</a> (<a>const</a>
--   (<a>const</a> <a>False</a>)) <a>True</a></tt></li>
--   <li><i><i>length</i></i> <tt><a>length</a> ≡ <a>getSum</a> .
--   <a>foldMap</a> (<a>const</a> (<a>Sum</a> 1))</tt></li>
--   </ul>
--   
--   Note that this checks to ensure that <tt>foldl'</tt> and
--   <tt>foldr'</tt> are suitably strict.
foldableLaws :: (Foldable f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following functor properties:
--   
--   <ul>
--   <li><i><i>Identity</i></i> <tt><a>fmap</a> <a>id</a> ≡
--   <a>id</a></tt></li>
--   <li><i><i>Composition</i></i> <tt><a>fmap</a> (f <a>.</a> g) ≡
--   <a>fmap</a> f <a>.</a> <a>fmap</a> g</tt></li>
--   <li><i><i>Const</i></i> <tt>(<a>&lt;$</a>) ≡ <a>fmap</a>
--   <a>const</a></tt></li>
--   </ul>
functorLaws :: (Functor f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following monadic properties:
--   
--   <ul>
--   <li><i><i>Left Identity</i></i> <tt><a>return</a> a <a>&gt;&gt;=</a> k
--   ≡ k a</tt></li>
--   <li><i><i>Right Identity</i></i> <tt>m <a>&gt;&gt;=</a> <a>return</a>
--   ≡ m</tt></li>
--   <li><i><i>Associativity</i></i> <tt>m <a>&gt;&gt;=</a> (\x -&gt; k x
--   <a>&gt;&gt;=</a> h) ≡ (m <a>&gt;&gt;=</a> k) <a>&gt;&gt;=</a>
--   h</tt></li>
--   <li><i><i>Return</i></i> <tt><a>pure</a> ≡ <a>return</a></tt></li>
--   <li><i><i>Ap</i></i> <tt>(<a>&lt;*&gt;</a>) ≡ <a>ap</a></tt></li>
--   </ul>
monadLaws :: (Monad f, Applicative f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following monad plus properties:
--   
--   <ul>
--   <li><i><i>Left Identity</i></i> <tt><a>mplus</a> <a>empty</a> x ≡
--   x</tt></li>
--   <li><i><i>Right Identity</i></i> <tt><a>mplus</a> x <a>empty</a> ≡
--   x</tt></li>
--   <li><i><i>Associativity</i></i> <tt><a>mplus</a> a (<a>mplus</a> b c)
--   ≡ <a>mplus</a> (<a>mplus</a> a b) c)</tt></li>
--   <li><i><i>Left Zero</i></i> <tt><a>mzero</a> <a>&gt;&gt;=</a> f ≡
--   <a>mzero</a></tt></li>
--   <li><i><i>Right Zero</i></i> <tt>m <a>&gt;&gt;</a> <a>mzero</a> ≡
--   <a>mzero</a></tt></li>
--   </ul>
monadPlusLaws :: (MonadPlus f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following monadic zipping properties:
--   
--   <ul>
--   <li><i><i>Naturality</i></i> <tt><a>liftM</a> (f <a>***</a> g)
--   (<a>mzip</a> ma mb) = <a>mzip</a> (<a>liftM</a> f ma) (<a>liftM</a> g
--   mb)</tt></li>
--   </ul>
--   
--   In the laws above, the infix function <tt><a>***</a></tt> refers to a
--   typeclass method of <tt>Arrow</tt>.
monadZipLaws :: (MonadZip f, Applicative f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | Tests the following <a>Traversable</a> properties:
--   
--   <ul>
--   <li><i><i>Naturality</i></i> <tt>t <a>.</a> <a>traverse</a> f ≡
--   <a>traverse</a> (t <a>.</a> f)</tt> for every applicative
--   transformation <tt>t</tt></li>
--   <li><i><i>Identity</i></i> <tt><a>traverse</a> <a>Identity</a> ≡
--   <a>Identity</a></tt></li>
--   <li><i><i>Composition</i></i> <tt><a>traverse</a> (<a>Compose</a>
--   <a>.</a> <a>fmap</a> g <a>.</a> f) ≡ <a>Compose</a> <a>.</a>
--   <a>fmap</a> (<a>traverse</a> g) <a>.</a> <a>traverse</a> f</tt></li>
--   <li><i><i>Sequence Naturality</i></i> <tt>t <a>.</a> <a>sequenceA</a>
--   ≡ <a>sequenceA</a> <a>.</a> <a>fmap</a> t</tt> for every applicative
--   transformation <tt>t</tt></li>
--   <li><i><i>Sequence Identity</i></i> <tt><a>sequenceA</a> <a>.</a>
--   <a>fmap</a> <a>Identity</a> ≡ <a>Identity</a></tt></li>
--   <li><i><i>Sequence Composition</i></i> <tt><a>sequenceA</a> <a>.</a>
--   <a>fmap</a> <a>Compose</a> ≡ <a>Compose</a> <a>.</a> <a>fmap</a>
--   <a>sequenceA</a> <a>.</a> <a>sequenceA</a></tt></li>
--   <li><i><i>foldMap</i></i> <tt><a>foldMap</a> ≡
--   <a>foldMapDefault</a></tt></li>
--   <li><i><i>fmap</i></i> <tt><a>fmap</a> ≡ <a>fmapDefault</a></tt></li>
--   </ul>
--   
--   Where an <i>applicative transformation</i> is a function
--   
--   <pre>
--   t :: (Applicative f, Applicative g) =&gt; f a -&gt; g a
--   </pre>
--   
--   preserving the <a>Applicative</a> operations, i.e.
--   
--   <ul>
--   <li>Identity: <tt>t (<a>pure</a> x) ≡ <a>pure</a> x</tt></li>
--   <li>Distributivity: <tt>t (x <a>&lt;*&gt;</a> y) ≡ t x
--   <a>&lt;*&gt;</a> t y</tt></li>
--   </ul>
traversableLaws :: (Traversable f, Eq1 f, Show1 f, Arbitrary1 f) => proxy f -> Laws

-- | A set of laws associated with a typeclass.
data Laws
Laws :: String -> [(String, Property)] -> Laws

-- | Name of the typeclass whose laws are tested
[lawsTypeclass] :: Laws -> String

-- | Pairs of law name and property
[lawsProperties] :: Laws -> [(String, Property)]

-- | In older versions of GHC, Proxy is not poly-kinded, so we provide
--   Proxy1.
data Proxy1 (f :: * -> *)
Proxy1 :: Proxy1

-- | In older versions of GHC, Proxy is not poly-kinded, so we provide
--   Proxy2.
data Proxy2 (f :: * -> * -> *)
Proxy2 :: Proxy2
instance Data.Semigroup.Semigroup Test.QuickCheck.Classes.Status
instance GHC.Base.Monoid Test.QuickCheck.Classes.Status
