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


-- | Hedgehog will eat your typeclass bugs
--   
--   This library provides Hedgehog 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 checkers. This library differs from
--   other solutions by not introducing any new typeclasses that the user
--   needs to learn, and otherwise minimal API overhead.
--   
--   This library is directly inspired by `quickcheck-classes`.
@package hedgehog-classes
@version 0.2.5.4

-- | This library provides sets of properties that should hold for common
--   typeclasses.
--   
--   Note: functions that test laws of a subclass never test the
--   laws of a superclass. For example, commutativeSemigroupLaws
--   never tests the laws provided by semigroupLaws.
module Hedgehog.Classes

-- | A convenience function for testing the properties of a typeclass. For
--   example, in GHCi:
--   
--   
--   >>> genOrdering :: Gen Ordering; genOrdering = frequency [(1,pure EQ),(1,pure LT),(1,pure GT)]
--   
--   >>> lawsCheck (monoidLaws genOrdering)
--   Monoid: Left Identity    ✓ <interactive> passed 100 tests.
--   Monoid: Right Identity    ✓ <interactive> passed 100 tests.
--   Monoid: Associativity    ✓ <interactive> passed 100 tests.
--   Monoid: Concatenation    ✓ <interactive> passed 100 tests.
--   True
--   
lawsCheck :: Laws -> IO Bool

-- | A convenience function for testing many typeclass instances of a
--   single type.
--   
--   
--   >>> lawsCheckOne (word8 constantBounded) [jsonLaws, showReadLaws]
--   ToJSON/FromJSON: Partial Isomorphism    ✓ <interactive> passed 100 tests.
--   ToJSON/FromJSON: Encoding equals value    ✓ <interactive> passed 100 tests.
--   Show/Read: Partial Isomorphism: show/read    ✓ <interactive> passed 100 tests.
--   Show/Read: Partial Isomorphism: show/read with initial space    ✓ <interactive> passed 100 tests.
--   Show/Read: Partial Isomorphism: showsPrec/readsPrec    ✓ <interactive> passed 100 tests.
--   Show/Read: Partial Isomorphism: showList/readList    ✓ <interactive> passed 100 tests.
--   Show/Read: Partial Isomorphism: showListWith shows/readListDefault    ✓ <interactive> passed 100 tests.
--   True
--   
lawsCheckOne :: Gen a -> [Gen a -> Laws] -> IO Bool

-- | A convenience function for checking many typeclass instances of
--   multiple types.
--   
--   
--   import Control.Applicative (liftA2)
--   
--   import Data.Map (Map)
--   import Data.Set (Set)
--   
--   import qualified Data.List as List
--   import qualified Data.Set as Set
--   import qualified Data.Map as Map
--   
--   import qualified Hedgehog.Gen as Gen
--   import qualified Hedgehog.Range as Range
--   
--   import Hedgehog (Gen)
--   import Hedgehog.Classes
--   
--   -- Generate a small Set Int
--   genSet :: Gen (Set Int)
--   genSet = Set.fromList <$> (Gen.list (Range.linear 2 10) (Gen.int Range.constantBounded))
--   
--   -- Generate a small Map String Int
--   genMap :: Gen (Map String Int)
--   genMap = Map.fromList <$> (liftA2 List.zip genStrings genInts)
--     where
--       rng = Range.linear 2 6
--       genStrings = Gen.list rng (Gen.string rng Gen.lower)
--       genInts = Gen.list rng (Gen.int Range.constantBounded)
--   
--   commonLaws :: (Eq a, Monoid a, Show a) => Gen a -> [Laws]
--   commonLaws p = [eqLaws p, monoidLaws p]
--   
--   tests :: [(String, [Laws])]
--   tests =
--     [ ("Set Int", commonLaws genSet)
--     , ("Map String Int", commonLaws genMap)
--     ]
--   
--   
--   Now, in GHCi:
--   
--   
--   >>> lawsCheckMany tests
--   
--   
--   
--   Testing properties for common typeclasses...
--   
--   -------------
--   -- Set Int --
--   -------------
--   
--   Eq: Transitive   ✓ interactive passed 100 tests.
--   Eq: Symmetric   ✓ interactive passed 100 tests.
--   Eq: Reflexive   ✓ interactive passed 100 tests.
--   Eq: Negation   ✓ interactive passed 100 tests.
--   Monoid: Left Identity   ✓ interactive passed 100 tests.
--   Monoid: Right Identity   ✓ interactive passed 100 tests.
--   Monoid: Associativity   ✓ interactive passed 100 tests.
--   Monoid: Concatenation   ✓ interactive passed 100 tests.
--   
--   --------------------
--   -- Map String Int --
--   --------------------
--   
--   Eq: Transitive   ✓ interactive passed 100 tests.
--   Eq: Symmetric   ✓ interactive passed 100 tests.
--   Eq: Reflexive   ✓ interactive passed 100 tests.
--   Eq: Negation   ✓ interactive passed 100 tests.
--   Monoid: Left Identity   ✓ interactive passed 100 tests.
--   Monoid: Right Identity   ✓ interactive passed 100 tests.
--   Monoid: Associativity   ✓ interactive passed 100 tests.
--   Monoid: Concatenation   ✓ interactive passed 100 tests.
--   
--   All tests succeeded
--   True
--   
lawsCheckMany :: [(String, [Laws])] -> IO Bool

-- | Tests the following Binary laws:
--   
--   
--   
- Encoding Partial Isomorphism decode
--   . encode ≡ id
--   
binaryLaws :: (Binary a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Bits laws:
--   
--   
--   
- Conjunction Idempotence n .&. n
--   ≡ n
--   
- Disjunction Idempotence n .|. n ≡
--   n
--   
- Double Complement complement .
--   complement ≡ id
--   
- Set Bit setBit n i ≡ n .|.
--   bit i
--   
- Clear Bit clearBit n i ≡ n
--   .&. complement (bit i)
--   
- Complement Bit complement n i ≡
--   xor n (bit i)
--   
- Clear Zero clearBit zeroBits
--   i ≡ zeroBits
--   
- Set Zero setBit zeroBits i ≡
--   zeroBits
--   
- Test Zero testBit zeroBits i
--   ≡ False
--   
- Pop Zero popCount zeroBits ≡
--   0
--   
- Count Leading Zeros of Zero
--   countLeadingZeros zeroBits ≡
--   finiteBitSize (undefined :: a)
--   
- Count Trailing Zeros of Zero
--   countTrailingZeros zeroBits ≡
--   finiteBitSize (undefined :: a)
--   
bitsLaws :: (FiniteBits a, Show a) => Gen a -> Laws

-- | Tests the following Eq laws:
--   
--   
--   
- Reflexivity x == x ≡
--   True
--   
- Symmetry x == y ≡ y ==
--   x
--   
- Transitivity x == y && y
--   == z ≡ x == z
--   
- Negation x /= y ≡ not (x
--   == y)
--   
eqLaws :: (Eq a, Show a) => Gen a -> Laws

-- | Tests the following Integral laws:
--   
--   
--   
- Quotient Remainder quot x y * y
--   + (rem x y) ≡ x
--   
- Division Modulus (div x y) * y
--   + (mod x y) ≡ x
--   
- Integer Roundtrip fromInteger .
--   toInteger ≡ id
--   
integralLaws :: (Integral a, Show a) => Gen a -> Laws

-- | Tests the following Monoid laws:
--   
--   
--   
- Left Identity mappend mempty
--   ≡ id
--   
- Right Identity flip mappend
--   mempty ≡ id
--   
- Associativity mappend a (mappend b
--   c) ≡ mappend (mappend a b) c
--   
- Concatenation mconcat ≡
--   foldr mappend mempty
--   
monoidLaws :: (Eq a, Monoid a, Show a) => Gen a -> Laws

-- | Tests the following Monoid laws:
--   
--   
--   
- Commutativity mappend a b ≡
--   mappend b a
--   
commutativeMonoidLaws :: (Eq a, Monoid a, Show a) => Gen a -> Laws

-- | Tests the following Ord laws:
--   
--   
--   
- Antisymmetry x <= y &&
--   y <= x ≡ x == y
--   
- Transitivity x <= y &&
--   y <= z ≡ x <= z
--   
- Reflexivity x <= x ≡
--   True
--   
- Totality x <= y || y
--   <= x ≡ True
--   
ordLaws :: forall a. (Ord a, Show a) => Gen a -> Laws

-- | Tests the following Enum laws:
--   
--   
--   
- Succ-Pred Identity succ .
--   pred ≡ id
--   
- Pred-Succ Identity pred .
--   succ ≡ id
--   
enumLaws :: (Enum a, Eq a, Show a) => Gen a -> Laws

-- | Tests the same laws as enumLaws, but uses the Bounded
--   constraint to ensure that succ and pred behave as though
--   they are total. This should always be preferred if your type has a
--   Bounded instance.
boundedEnumLaws :: (Bounded a, Enum a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Semigroup laws:
--   
--   
--   
- Associativity a <> (b
--   <> c) ≡ (a <> b) <>
--   c
--   
- Concatenation sconcat ≡
--   foldr1 (<>)
--   
- Times stimes n a ≡ foldr1
--   (<>) (replicate n a)
--   
semigroupLaws :: (Eq a, Semigroup a, Show a) => Gen a -> Laws

-- | Tests the following Semigroup laws:
--   
--   
--   
- Commutativity a <> b ≡ b
--   <> a
--   
commutativeSemigroupLaws :: (Eq a, Semigroup a, Show a) => Gen a -> Laws

-- | Tests the following Semigroup laws:
--   
--   
--   
- Exponentiality stimes n (a
--   <> b) ≡ stimes n a <>
--   stimes n b
--   
exponentialSemigroupLaws :: (Eq a, Semigroup a, Show a) => Gen a -> Laws

-- | Tests the following Semigroup laws:
--   
--   
--   
- Idempotency a <> a ≡
--   a
--   
idempotentSemigroupLaws :: (Eq a, Semigroup a, Show a) => Gen a -> Laws

-- | Tests the following Semigroup laws:
--   
--   
--   
- Rectangular Bandedness a <> b
--   <> a ≡ a
--   
rectangularBandSemigroupLaws :: (Eq a, Semigroup a, Show a) => Gen a -> Laws

-- | Tests the following ToJSON / FromJSON laws:
--   
--   
--   
- Encoding Partial Isomorphism decode
--   . encode ≡ Just
--   
- Encoding Equals Value decode .
--   encode ≡ Just . toJSON
--   
jsonLaws :: (FromJSON a, ToJSON a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Generic laws:
--   
--   
--   
- From-To Inverse from .
--   to ≡ id
--   
- To-From Inverse to .
--   from ≡ id
--   
genericLaws :: (Generic a, Eq a, Show a, Eq (Rep a x), Show (Rep a x)) => Gen a -> Gen (Rep a x) -> Laws

-- | Tests the following Prim laws:
--   
--   
--   
- ByteArray Set-Get primitive_
--   (writeByteArray# ba# ix# x) *> primitive
--   (readByteArray# ba# ix#) ≡ pure x
--   
- ByteArray Get-Set primitive
--   (readByteArray# ba# ix#) >>= x ->
--   primitive_ (writeByteArray# ba# ix# x) ≡
--   pure ()
--   
- ByteArray Set-Set primitive_
--   (writeByteArray# ba# ix# x) *> primitive_
--   (writeByteArray# ba# ix# x) ≡ primitive_
--   (writeByteArray# ba# ix# x)
--   
- ByteArray Set Range The behavior of
--   setByteArray# matches the default implementation
--   
- ByteArray List Conversion Roundtrips Turning a list
--   into a PrimArray and back gives you the same list
--   
- Addr Set-Get primitive_
--   (writeOffAddr# addr# ix# x) *> primitive
--   (readOffAddr# addr# ix#) ≡ pure x
--   
- Addr Get-Set primitive
--   (readOffAddr# addr# ix#) >>= x ->
--   primitive_ (writeOffAddr# addr# ix# x) ≡
--   pure ()
--   
- Addr Set-Set primitive_
--   (writeOffAddr# addr# ix# x) *> primitive_
--   (writeOffAddr# addr# ix# x) ≡ primitive_
--   (writeOffAddr# addr# ix# x)
--   
- Addr Set Range The behavior of setOffAddr#
--   matches the default implementation
--   
- Addr List Conversion Roundtrips Mallocing a list and
--   then reconstructing it gives you the same list
--   
primLaws :: (Prim a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Semiring laws:
--   
--   
--   
- Additive Left Identity zero +
--   x ≡ x
--   
- Additive Right Identity x +
--   zero ≡ x
--   
- Additive Associativity x + (y +
--   z) ≡ (x + y) + z
--   
- Additive Commutativity x + y ≡ y
--   + x
--   
- Multiplicative Left Identity one *
--   x ≡ x
--   
- Multiplicative Right Identity x *
--   one ≡ x
--   
- Multiplicative Associativity x * (y
--   * z) ≡ (x * y) * z
--   
- Multiplicatiion Left-Distributes Over Addtion x
--   * (y + z) ≡ (x * y) + (x *
--   z)
--   
- Multiplication Right-Distibutes Over Addition (y
--   + z) * x ≡ (y * x) + (z *
--   x)
--   
- Multiplicative Left Annihilation zero
--   * x ≡ zero
--   
- Multiplicative Right Annihilation x *
--   zero ≡ zero
--   
semiringLaws :: (Semiring a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Ring laws:
--   
--   
--   
- Additive Inverse negate x + x
--   ≡ zero
--   
ringLaws :: (Ring a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Star laws:
--   
--   
--   
- Asteration star x ≡ one
--   + x * star x
--   
- APlus aplus x ≡ x *
--   star x
--   
starLaws :: (Star a, Eq a, Show a) => Gen a -> Laws

-- | Tests the following Show laws:
--   
--   
--   
- ShowsPrec Zero show a ≡
--   showsPrec 0 a ""
--   
- ShowsPrec Equivariance showsPrec p a r
--   ++ s ≡ 'showsPrec p a (r ++ s)
--   
- ShowsPrec ShowList showList as r
--   ++ s ≡ showList as (r ++ s)
--   
showLaws :: Show a => Gen a -> Laws

-- | Tests the following Show / Read laws:
--   
--   
--   
- Partial Isomorphism: show/read readMaybe
--   . show ≡ Just
--   
- Partial Isomorphism: show/read with initial space
--   readMaybe . (" " ++) .
--   show ≡ Just
--   
- Partial Isomorphism: showsPrec/readPrec (a,"")
--   elem readsPrec p (showsPrec p a "") ≡
--   True
--   
- Partial Isomorphism: showList/readList (as,"")
--   elem readList (showList as "") ≡
--   True
--   
- Partial Isomorphism: showListWith
--   shows/readListDefault (as,"") elem
--   readListDefault (showListWith shows as "") ≡
--   True
--   
showReadLaws :: (Eq a, Read a, Show a) => Gen a -> Laws

-- | Tests the following Storable laws:
--   
--   
--   
- Set-Get pokeElemOff ptr ix a
--   >> peekElemOff ptr ix ≡ pure
--   a
--   
- Get-Set peekElemOff ptr ix
--   >>= pokeElemOff ptr ix ≡ pure
--   () (Putting back what you got out has no effect)
--   
- List Conversion Roundtrips Mallocing a list and then
--   reconstructing it gives you the same list
--   
- PeekElemOff/Peek peekElemOff a i ≡
--   peek (plusPtr a (i * sizeOf
--   undefined))
--   
- PokeElemOff/Poke pokeElemOff a i x ≡
--   poke (plusPtr a (i * sizeOf
--   undefined)) x
--   
- PeekByteOff/Peek peekByteOff a i ≡
--   peek (plusPtr a i)
--   
- PokeByteOff/Peek pokeByteOff a i x ≡
--   poke (plusPtr a i) x
--   
storableLaws :: (Eq a, Show a, Storable a) => Gen a -> Laws

-- | Test that a MVector instance obey several laws.
muvectorLaws :: (Eq a, Unbox a, Show a) => Gen a -> Laws

-- | Tests the following Alternative laws:
--   
--   
--   
- Left Identity empty <|>
--   a ≡ a
--   
- Right Identity a <|>
--   empty ≡ a
--   
- Associativity a <|> (b
--   <|> c) ≡ (a <|> b) <|>
--   c
--   
alternativeLaws :: (Alternative f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Applicative laws:
--   
--   
--   
- Identity pure id <*>
--   v ≡ v
--   
- Composition pure (.)
--   <*> u <*> v <*> w ≡ u
--   <*> (v <*> w)
--   
- Homomorphism pure f <*>
--   pure x ≡ pure (f x)
--   
- Interchange u <*> pure
--   y ≡ pure ($ y) <*> u
--   
- LiftA2 1 liftA2 id f x ≡
--   f <*> x
--   
- LiftA2 2 liftA2 f x y ≡ f
--   <$> x <*> y
--   
applicativeLaws :: (Applicative f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Comonad laws:
--   
--   
--   
- Extend/Extract Identity extend
--   extract ≡ id
--   
- Extract/Extend extract .
--   extend f ≡ f
--   
- Extend/Extend extend f .
--   extend g ≡ extend (f . extend g)
--   
- Extract Right Identity f =>=
--   extract ≡ f
--   
- Extract Left Identity extract
--   =>= f ≡ f
--   
- Cokleisli Associativity (f =>= g)
--   =>= h ≡ f =>= (g =>= h)
--   
- Extract/Duplicate Identity extract
--   . duplicate ≡ id
--   
- Fmap Extract/Duplicate Identity fmap
--   extract . duplicate ≡ id
--   
- Double Duplication duplicate .
--   duplicate ≡ fmap duplicate .
--   duplicate
--   
- Extend/Fmap . Duplicate Identity extend f
--   ≡ fmap f . duplicate
--   
- Duplicate/Extend id Identity duplicate ≡
--   extend id
--   
- Fmap/Extend Extract fmap f ≡
--   extend (f . extract)
--   
- Fmap/LiftW Isomorphism fmap ≡
--   liftW
--   
comonadLaws :: (Comonad f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Contravariant laws:
--   
--   
--   
- Identity contramap id ≡
--   id
--   
- Composition contramap f .
--   contramap g ≡ contramap (g .
--   f)
--   
contravariantLaws :: (Contravariant f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Foldable laws:
--   
--   
--   
- Fold fold ≡ foldMap
--   id
--   
- FoldMap foldMap f ≡ foldr
--   (mappend . f) mempty
--   
- Foldr foldr f z t ≡ appEndo
--   (foldMap (Endo . f) t) z
--   
- Foldr' foldr' f z0 t ≡ foldl f'
--   id t z0, where f' k x z = k $! f x z
--   
- Foldl foldl f z t ≡ appEndo
--   (getDual (foldMap (Dual . Endo
--   . flip f) t)) z
--   
- Foldl' foldl' f z0 xs ≡ foldr f'
--   id xs z0, where f' x k z = k $! f z x
--   
- Foldl1 foldl1 f t ≡ let (x:xs) =
--   toList t in foldl f x xs
--   
- Foldr1 foldr1 f t ≡ let (xs,x) =
--   unsnoc (toList t) in foldr f x xs
--   
- ToList toList ≡ foldr (:)
--   []
--   
- Null null ≡ foldr (const
--   (const False)) True
--   
- Length length ≡ getSum .
--   foldMap (const (Sum 1))
--   
--   
--   This additionally tests that the user's implementations of
--   foldr' and foldl' are strict in their accumulators.
foldableLaws :: (Foldable f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Functor laws:
--   
--   
--   
- Identity fmap id ≡
--   id
--   
- Composition fmap f . fmap
--   g ≡ fmap (f . g)
--   
- Const fmap (const x) ≡ x
--   <$
--   
functorLaws :: (Functor f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Monad laws:
--   
--   
--   
- Left Identity return a >>=
--   k ≡ k a
--   
- Right Identity m >>=
--   return ≡ m
--   
- Associativity m >>= (\x -> k x
--   >>= h) ≡ (m >>= k) >>=
--   h
--   
- Return return ≡
--   pure
--   
- Ap ap f x ≡ f <*>
--   x
--   
monadLaws :: (Monad f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following MonadIO laws:
--   
--   
--   
- Return liftIO . return
--   ≡ return
--   
- Lift liftIO (m >>= f) ≡
--   liftIO m >>= (liftIO .
--   f)
--   
monadIOLaws :: (MonadIO f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following MonadPlus laws:
--   
--   
--   
- Left Identity mplus mzero ≡
--   id
--   
- Right Identity flip mplus
--   mzero ≡ id
--   
- Associativity mplus a (mplus b
--   c) ≡ mplus (mplus a b) c
--   
- Left Zero mzero >>= f ≡
--   mzero
--   
- Right Zero v >> mzero ≡
--   mzero
--   
monadPlusLaws :: (MonadPlus f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following MonadZip laws:
--   
--   
--   
- Naturality fmap (f *** g)
--   (mzip ma mb) ≡ mzip (fmap f ma)
--   (fmap g mb)
--   
monadZipLaws :: (MonadZip f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Traversable laws:
--   
--   
--   
- Naturality t . traverse f ≡
--   traverse (t . f), for every applicative
--   transformation t
--   
- Identity traverse Identity ≡
--   Identity
--   
- Composition traverse (Compose
--   . fmap g . f) ≡ Compose .
--   fmap (traverse g) . traverse f
--   
- SequenceA Naturality t .
--   sequenceA ≡ sequenceA . fmap t,
--   for every applicative transformation t
--   
- SequenceA Identity sequenceA .
--   fmap Identity ≡ Identity
--   
- SequenceA Composition sequenceA .
--   fmap Compose ≡ Compose .
--   fmap sequenceA . sequenceA
--   
- FoldMap foldMap ≡
--   foldMapDefault
--   
- Fmap fmap ≡
--   fmapDefault
--   
traversableLaws :: (Traversable f, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => (forall x. Gen x -> Gen (f x)) -> Laws

-- | Tests the following Arrow laws:
--   
--   
--   
- Arr Identity arr id ≡
--   id
--   
- Arr Composition arr (f
--   >>> g) ≡ arr f >>>
--   arr g
--   
- Arr-First inverse first (arr
--   f) ≡ arr (first f)
--   
- First Composition first (f
--   >>> g) ≡ first f >>>
--   first g
--   
- Arrow Law 5 first f >>>
--   arr fst ≡ arr fst
--   >>> f
--   
- Arrow Law 6 first f >>>
--   arr (id *** g) ≡ arr (id
--   *** g) >>> first f
--   
- Arrow Law 7 first (first f)
--   >>> arr assoc ≡ arr assoc
--   >>> first f, where assoc ((a,b),c) =
--   (a,(b,c))
--   
arrowLaws :: forall f. (Arrow f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Bifoldable laws:
--   
--   
--   
- Identity bifold ≡
--   bifoldMap id id
--   
- FoldMap bifoldMap f g ≡
--   bifoldr (mappend . f) (mappend
--   . g) mempty
--   
- Foldr bifoldr f g z t ≡
--   appEndo (bifoldMap (Endo . f)
--   (Endo . g) t) z
--   
bifoldableLaws :: forall f. (Bifoldable f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Bifoldable / Bifunctor laws:
--   
--   
--   
- Composition bifoldMap f g ≡
--   bifold . bimap f g
--   
- FoldMap bifoldMap f g .
--   bimap h i ≡ bifoldMap (f . h) (g
--   . i)
--   
bifoldableFunctorLaws :: forall f. (Bifoldable f, Bifunctor f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Bifunctor laws:
--   
--   
--   
- Identity bimap id id ≡
--   id
--   
- First Identity first id ≡
--   id
--   
- Second Identity second id ≡
--   id
--   
- Composition bimap id
--   id ≡ first id . second
--   id
--   
bifunctorLaws :: forall f. (Bifunctor f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Bitraversable laws:
--   
--   
--   
- Naturality bitraverse (t . f) (t
--   . g) ≡ t . bitraverse f g, for every
--   applicative transformation t
--   
- Identity bitraverse Identity
--   Identity ≡ Identity
--   
- Composition Compose . fmap
--   (bitraverse g1 g2) . bitraverse f1 f2 ≡
--   bitraverse (Compose . fmap g1 .
--   f1) (Compose . fmap g2 . f2)
--   
bitraversableLaws :: forall f. (Bitraversable f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Category laws:
--   
--   
--   
- Left Identity id . f ≡
--   f
--   
- Right Identity f . id ≡
--   f
--   
- Associativity f . (g . h) ≡
--   (f . g) . h
--   
categoryLaws :: forall f. (Category f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | Tests the following Category laws:
--   
--   
--   
- Commutativity f . g ≡ g .
--   f
--   
commutativeCategoryLaws :: forall f. (Category f, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => (forall x y. Gen x -> Gen y -> Gen (f x y)) -> Laws

-- | A Laws is the name of the typeclass and the set of named
--   properties associated with that typeclass.
data Laws
Laws :: String -> [(String, Property)] -> Laws
[lawsTypeClass] :: Laws -> String
[lawsProperties] :: Laws -> [(String, Property)]

-- | The context surrounding the property test of a law. Use
--   contextualise to turn this into a Context.
data LawContext
LawContext :: String -> String -> String -> String -> String -> LawContext

-- | law name
[lawContextLawName] :: LawContext -> String

-- | law body
[lawContextLawBody] :: LawContext -> String

-- | typeclass name
[lawContextTcName] :: LawContext -> String

-- | how to show the specific property test
[lawContextTcProp] :: LawContext -> String

-- | reduced equation, eg "LHS = RHS" where neither LHS nor RHS are
--   reducible
[lawContextReduced] :: LawContext -> String

-- | You can provide a Context to
--   heqCtx,heqCtx1,heqCtx2,hneqCtx,hneqCtx1,or
--   hneqCtx2. The Context is used to provide useful error
--   messages in the event of a failure.
data Context
NoContext :: Context
Context :: String -> Context

-- | Turn a LawContext into a Context.
contextualise :: LawContext -> Context

-- | Fails the test if the right argument is less than or equal to the
--   left. see
--   https://github.com/hedgehogqa/haskell-hedgehog/pull/196
hLessThan :: (MonadTest m, Ord a, Show a, HasCallStack) => a -> a -> m ()

-- | Fails the test if the right argument is greater than or equal to the
--   left. see
--   https://github.com/hedgehogqa/haskell-hedgehog/pull/196
hGreaterThan :: (MonadTest m, Ord a, Show a, HasCallStack) => a -> a -> m ()

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   NoContext.
heq :: (MonadTest m, HasCallStack, Eq a, Show a) => a -> a -> m ()
infix 4 `heq`

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   NoContext.
heq1 :: (MonadTest m, HasCallStack, Eq a, Show a, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => f a -> f a -> m ()
infix 4 `heq1`

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   NoContext.
heq2 :: (MonadTest m, HasCallStack, Eq a, Eq b, Show a, Show b, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => f a b -> f a b -> m ()
infix 4 `heq2`

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   the given Context.
heqCtx :: (MonadTest m, HasCallStack, Eq a, Show a) => a -> a -> Context -> m ()

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   the given Context.
heqCtx1 :: (MonadTest m, HasCallStack, Eq a, Show a, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => f a -> f a -> Context -> m ()

-- | Passes the test if the given arguments are equal. Otherwise fails with
--   the given Context.
heqCtx2 :: (MonadTest m, HasCallStack, Eq a, Eq b, Show a, Show b, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => f a b -> f a b -> Context -> m ()

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with NoContext.
hneq :: (MonadTest m, HasCallStack, Eq a, Show a) => a -> a -> m ()
infix 4 `hneq`

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with NoContext.
hneq1 :: (MonadTest m, HasCallStack, Eq a, Show a, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => f a -> f a -> m ()

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with NoContext.
hneq2 :: (MonadTest m, HasCallStack, Eq a, Eq b, Show a, Show b, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => f a b -> f a b -> m ()
infix 4 `hneq2`

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with the given Context.
hneqCtx :: (MonadTest m, HasCallStack, Eq a, Show a) => a -> a -> Context -> m ()

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with the given Context.
hneqCtx1 :: (MonadTest m, HasCallStack, Eq a, Show a, forall x. Eq x => Eq (f x), forall x. Show x => Show (f x)) => f a -> f a -> Context -> m ()

-- | Passes the test if the given arguments are not equal. Otherwise fails
--   with the given Context.
hneqCtx2 :: (MonadTest m, HasCallStack, Eq a, Eq b, Show a, Show b, forall x y. (Eq x, Eq y) => Eq (f x y), forall x y. (Show x, Show y) => Show (f x y)) => f a b -> f a b -> Context -> m ()
