{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE UndecidableInstances #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | This module exports 'QC.arbitrary' instances for 'Exinst.Some1', 'Some2',
-- 'Some3' and 'Some4' from "Exinst", provided situable 'Dict1',
-- 'Dict2', 'Dict3' and 'Dict4' instances are available.
--
-- See the README file for more general documentation: https://hackage.haskell.org/package/exinst#readme
module Exinst.QuickCheck () where

import Data.Constraint
import Data.Kind (Type)
import Data.Singletons (SingKind, Sing, Demote, withSomeSing)
import qualified Test.QuickCheck as QC

import Exinst.Internal
import Exinst.Internal.Sum
import Exinst.Internal.Product

--------------------------------------------------------------------------------

instance
  forall k1 (f :: k1 -> Type).
  ( SingKind k1
  , QC.Arbitrary (Demote k1)
  , Dict1 QC.Arbitrary f
  ) => QC.Arbitrary (Some1 f) where
  arbitrary :: Gen (Some1 f)
arbitrary = do
    Demote k1
da1 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k1
da1 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa1 :: Sing (a1 :: k1)) ->
      case forall k0 k1 (c :: k0 -> Constraint) (f1 :: k1 -> k0) (a1 :: k1).
Dict1 c f1 =>
Sing a1 -> Dict (c (f1 a1))
dict1 Sing a
sa1 :: Dict (QC.Arbitrary (f a1)) of
        Dict (Arbitrary (f a))
Dict -> forall k1 (f1 :: k1 -> *) (a1 :: k1). Sing a1 -> f1 a1 -> Some1 f1
Some1 Sing a
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: Some1 f -> [Some1 f]
shrink = \Some1 f
s1x -> forall k1 (f1 :: k1 -> *) r.
Some1 f1
-> (forall (a1 :: k1). SingI a1 => Sing a1 -> f1 a1 -> r) -> r
withSome1Sing Some1 f
s1x forall a b. (a -> b) -> a -> b
$ \Sing a1
sa1 (f a1
x :: f a1) ->
    case forall k0 k1 (c :: k0 -> Constraint) (f1 :: k1 -> k0) (a1 :: k1).
Dict1 c f1 =>
Sing a1 -> Dict (c (f1 a1))
dict1 Sing a1
sa1 :: Dict (QC.Arbitrary (f a1)) of
      Dict (Arbitrary (f a1))
Dict -> forall k1 (f1 :: k1 -> *) (a1 :: k1). Sing a1 -> f1 a1 -> Some1 f1
Some1 Sing a1
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink f a1
x

instance
  forall k2 k1 (f :: k2 -> k1 -> Type).
  ( SingKind k2
  , SingKind k1
  , QC.Arbitrary (Demote k2)
  , QC.Arbitrary (Demote k1)
  , Dict2 QC.Arbitrary f
  ) => QC.Arbitrary (Some2 f) where
  arbitrary :: Gen (Some2 f)
arbitrary = do
    Demote k2
da2 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k1
da1 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k2
da2 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa2 :: Sing (a2 :: k2)) ->
      forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k1
da1 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa1 :: Sing (a1 :: k1)) ->
        case forall k0 k2 k1 (c :: k0 -> Constraint) (f2 :: k2 -> k1 -> k0)
       (a2 :: k2) (a1 :: k1).
Dict2 c f2 =>
Sing a2 -> Sing a1 -> Dict (c (f2 a2 a1))
dict2 Sing a
sa2 Sing a
sa1 :: Dict (QC.Arbitrary (f a2 a1)) of
          Dict (Arbitrary (f a a))
Dict -> forall k2 k1 (f2 :: k2 -> k1 -> *) (a2 :: k2) (a1 :: k1).
Sing a2 -> Sing a1 -> f2 a2 a1 -> Some2 f2
Some2 Sing a
sa2 Sing a
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: Some2 f -> [Some2 f]
shrink = \Some2 f
s2x -> forall k2 k1 (f2 :: k2 -> k1 -> *) r.
Some2 f2
-> (forall (a2 :: k2) (a1 :: k1).
    (SingI a2, SingI a1) =>
    Sing a2 -> Sing a1 -> f2 a2 a1 -> r)
-> r
withSome2Sing Some2 f
s2x forall a b. (a -> b) -> a -> b
$ \Sing a2
sa2 Sing a1
sa1 (f a2 a1
x :: f a2 a1) ->
    case forall k0 k2 k1 (c :: k0 -> Constraint) (f2 :: k2 -> k1 -> k0)
       (a2 :: k2) (a1 :: k1).
Dict2 c f2 =>
Sing a2 -> Sing a1 -> Dict (c (f2 a2 a1))
dict2 Sing a2
sa2 Sing a1
sa1 :: Dict (QC.Arbitrary (f a2 a1)) of
      Dict (Arbitrary (f a2 a1))
Dict -> forall k2 k1 (f2 :: k2 -> k1 -> *) (a2 :: k2) (a1 :: k1).
Sing a2 -> Sing a1 -> f2 a2 a1 -> Some2 f2
Some2 Sing a2
sa2 Sing a1
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink f a2 a1
x

instance
  forall k3 k2 k1 (f :: k3 -> k2 -> k1 -> Type).
  ( SingKind k3
  , SingKind k2
  , SingKind k1
  , QC.Arbitrary (Demote k3)
  , QC.Arbitrary (Demote k2)
  , QC.Arbitrary (Demote k1)
  , Dict3 QC.Arbitrary f
  ) => QC.Arbitrary (Some3 f) where
  arbitrary :: Gen (Some3 f)
arbitrary = do
    Demote k3
da3 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k2
da2 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k1
da1 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k3
da3 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa3 :: Sing (a3 :: k3)) ->
      forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k2
da2 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa2 :: Sing (a2 :: k2)) ->
        forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k1
da1 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa1 :: Sing (a1 :: k1)) ->
          case forall k0 k3 k2 k1 (c :: k0 -> Constraint)
       (f3 :: k3 -> k2 -> k1 -> k0) (a3 :: k3) (a2 :: k2) (a1 :: k1).
Dict3 c f3 =>
Sing a3 -> Sing a2 -> Sing a1 -> Dict (c (f3 a3 a2 a1))
dict3 Sing a
sa3 Sing a
sa2 Sing a
sa1 :: Dict (QC.Arbitrary (f a3 a2 a1)) of
            Dict (Arbitrary (f a a a))
Dict -> forall k3 k2 k1 (f3 :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
Sing a3 -> Sing a2 -> Sing a1 -> f3 a3 a2 a1 -> Some3 f3
Some3 Sing a
sa3 Sing a
sa2 Sing a
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: Some3 f -> [Some3 f]
shrink = \Some3 f
s3x -> forall k3 k2 k1 (f3 :: k3 -> k2 -> k1 -> *) r.
Some3 f3
-> (forall (a3 :: k3) (a2 :: k2) (a1 :: k1).
    (SingI a3, SingI a2, SingI a1) =>
    Sing a3 -> Sing a2 -> Sing a1 -> f3 a3 a2 a1 -> r)
-> r
withSome3Sing Some3 f
s3x forall a b. (a -> b) -> a -> b
$ \Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 (f a3 a2 a1
x :: f a3 a2 a1) ->
    case forall k0 k3 k2 k1 (c :: k0 -> Constraint)
       (f3 :: k3 -> k2 -> k1 -> k0) (a3 :: k3) (a2 :: k2) (a1 :: k1).
Dict3 c f3 =>
Sing a3 -> Sing a2 -> Sing a1 -> Dict (c (f3 a3 a2 a1))
dict3 Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 :: Dict (QC.Arbitrary (f a3 a2 a1)) of
      Dict (Arbitrary (f a3 a2 a1))
Dict -> forall k3 k2 k1 (f3 :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
Sing a3 -> Sing a2 -> Sing a1 -> f3 a3 a2 a1 -> Some3 f3
Some3 Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink f a3 a2 a1
x

instance
  forall k4 k3 k2 k1 (f :: k4 -> k3 -> k2 -> k1 -> Type).
  ( SingKind k4
  , SingKind k3
  , SingKind k2
  , SingKind k1
  , QC.Arbitrary (Demote k4)
  , QC.Arbitrary (Demote k3)
  , QC.Arbitrary (Demote k2)
  , QC.Arbitrary (Demote k1)
  , Dict4 QC.Arbitrary f
  ) => QC.Arbitrary (Some4 f) where
  arbitrary :: Gen (Some4 f)
arbitrary = do
    Demote k4
da4 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k3
da3 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k2
da2 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    Demote k1
da1 <- forall a. Arbitrary a => Gen a
QC.arbitrary
    forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k4
da4 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa4 :: Sing (a4 :: k4)) ->
      forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k3
da3 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa3 :: Sing (a3 :: k3)) ->
        forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k2
da2 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa2 :: Sing (a2 :: k2)) ->
          forall k r.
SingKind k =>
Demote k -> (forall (a :: k). Sing a -> r) -> r
withSomeSing Demote k1
da1 forall a b. (a -> b) -> a -> b
$ \(Sing a
sa1 :: Sing (a1 :: k1)) ->
            case forall k0 k4 k3 k2 k1 (c :: k0 -> Constraint)
       (f4 :: k4 -> k3 -> k2 -> k1 -> k0) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
Dict4 c f4 =>
Sing a4
-> Sing a3 -> Sing a2 -> Sing a1 -> Dict (c (f4 a4 a3 a2 a1))
dict4 Sing a
sa4 Sing a
sa3 Sing a
sa2 Sing a
sa1 :: Dict (QC.Arbitrary (f a4 a3 a2 a1)) of
              Dict (Arbitrary (f a a a a))
Dict -> forall k4 k3 k2 k1 (f4 :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4)
       (a3 :: k3) (a2 :: k2) (a1 :: k1).
Sing a4
-> Sing a3 -> Sing a2 -> Sing a1 -> f4 a4 a3 a2 a1 -> Some4 f4
Some4 Sing a
sa4 Sing a
sa3 Sing a
sa2 Sing a
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: Some4 f -> [Some4 f]
shrink = \Some4 f
s3x -> forall k4 k3 k2 k1 (f4 :: k4 -> k3 -> k2 -> k1 -> *) r.
Some4 f4
-> (forall (a4 :: k4) (a3 :: k3) (a2 :: k2) (a1 :: k1).
    (SingI a4, SingI a3, SingI a2, SingI a1) =>
    Sing a4 -> Sing a3 -> Sing a2 -> Sing a1 -> f4 a4 a3 a2 a1 -> r)
-> r
withSome4Sing Some4 f
s3x forall a b. (a -> b) -> a -> b
$ \Sing a4
sa4 Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 (f a4 a3 a2 a1
x :: f a4 a3 a2 a1) ->
    case forall k0 k4 k3 k2 k1 (c :: k0 -> Constraint)
       (f4 :: k4 -> k3 -> k2 -> k1 -> k0) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
Dict4 c f4 =>
Sing a4
-> Sing a3 -> Sing a2 -> Sing a1 -> Dict (c (f4 a4 a3 a2 a1))
dict4 Sing a4
sa4 Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 :: Dict (QC.Arbitrary (f a4 a3 a2 a1)) of
      Dict (Arbitrary (f a4 a3 a2 a1))
Dict -> forall k4 k3 k2 k1 (f4 :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4)
       (a3 :: k3) (a2 :: k2) (a1 :: k1).
Sing a4
-> Sing a3 -> Sing a2 -> Sing a1 -> f4 a4 a3 a2 a1 -> Some4 f4
Some4 Sing a4
sa4 Sing a3
sa3 Sing a2
sa2 Sing a1
sa1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink f a4 a3 a2 a1
x

--------------------------------------------------------------------------------

instance (QC.Arbitrary (l a1), QC.Arbitrary (r a1)) => QC.Arbitrary (S1 l r a1) where
  arbitrary :: Gen (S1 l r a1)
arbitrary = forall a. [Gen a] -> Gen a
QC.oneof [ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
l a1 -> S1 l r a1
S1L forall a. Arbitrary a => Gen a
QC.arbitrary, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
r a1 -> S1 l r a1
S1R forall a. Arbitrary a => Gen a
QC.arbitrary ]
  shrink :: S1 l r a1 -> [S1 l r a1]
shrink (S1L l a1
l) = forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
l a1 -> S1 l r a1
S1L forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a1
l
  shrink (S1R r a1
r) = forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
r a1 -> S1 l r a1
S1R forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink r a1
r
instance (QC.Arbitrary (l a2 a1), QC.Arbitrary (r a2 a1)) => QC.Arbitrary (S2 l r a2 a1) where
  arbitrary :: Gen (S2 l r a2 a1)
arbitrary = forall a. [Gen a] -> Gen a
QC.oneof [ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
l a2 a1 -> S2 l r a2 a1
S2L forall a. Arbitrary a => Gen a
QC.arbitrary, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
r a2 a1 -> S2 l r a2 a1
S2R forall a. Arbitrary a => Gen a
QC.arbitrary ]
  shrink :: S2 l r a2 a1 -> [S2 l r a2 a1]
shrink (S2L l a2 a1
l) = forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
l a2 a1 -> S2 l r a2 a1
S2L forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a2 a1
l
  shrink (S2R r a2 a1
r) = forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
r a2 a1 -> S2 l r a2 a1
S2R forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink r a2 a1
r
instance (QC.Arbitrary (l a3 a2 a1), QC.Arbitrary (r a3 a2 a1)) => QC.Arbitrary (S3 l r a3 a2 a1) where
  arbitrary :: Gen (S3 l r a3 a2 a1)
arbitrary = forall a. [Gen a] -> Gen a
QC.oneof [ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
l a3 a2 a1 -> S3 l r a3 a2 a1
S3L forall a. Arbitrary a => Gen a
QC.arbitrary, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
r a3 a2 a1 -> S3 l r a3 a2 a1
S3R forall a. Arbitrary a => Gen a
QC.arbitrary ]
  shrink :: S3 l r a3 a2 a1 -> [S3 l r a3 a2 a1]
shrink (S3L l a3 a2 a1
l) = forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
l a3 a2 a1 -> S3 l r a3 a2 a1
S3L forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a3 a2 a1
l
  shrink (S3R r a3 a2 a1
r) = forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
r a3 a2 a1 -> S3 l r a3 a2 a1
S3R forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink r a3 a2 a1
r
instance (QC.Arbitrary (l a4 a3 a2 a1), QC.Arbitrary (r a4 a3 a2 a1)) => QC.Arbitrary (S4 l r a4 a3 a2 a1) where
  arbitrary :: Gen (S4 l r a4 a3 a2 a1)
arbitrary = forall a. [Gen a] -> Gen a
QC.oneof [ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
l a4 a3 a2 a1 -> S4 l r a4 a3 a2 a1
S4L forall a. Arbitrary a => Gen a
QC.arbitrary, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
r a4 a3 a2 a1 -> S4 l r a4 a3 a2 a1
S4R forall a. Arbitrary a => Gen a
QC.arbitrary ]
  shrink :: S4 l r a4 a3 a2 a1 -> [S4 l r a4 a3 a2 a1]
shrink (S4L l a4 a3 a2 a1
l) = forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
l a4 a3 a2 a1 -> S4 l r a4 a3 a2 a1
S4L forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a4 a3 a2 a1
l
  shrink (S4R r a4 a3 a2 a1
r) = forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
r a4 a3 a2 a1 -> S4 l r a4 a3 a2 a1
S4R forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink r a4 a3 a2 a1
r

--------------------------------------------------------------------------------

instance (QC.Arbitrary (l a1), QC.Arbitrary (r a1)) => QC.Arbitrary (P1 l r a1) where
  arbitrary :: Gen (P1 l r a1)
arbitrary = forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
l a1 -> r a1 -> P1 l r a1
P1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: P1 l r a1 -> [P1 l r a1]
shrink (P1 l a1
x r a1
y) = forall k1 (l :: k1 -> *) (r :: k1 -> *) (a1 :: k1).
l a1 -> r a1 -> P1 l r a1
P1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a1
x forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => a -> [a]
QC.shrink r a1
y
instance (QC.Arbitrary (l a2 a1), QC.Arbitrary (r a2 a1)) => QC.Arbitrary (P2 l r a2 a1) where
  arbitrary :: Gen (P2 l r a2 a1)
arbitrary = forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
l a2 a1 -> r a2 a1 -> P2 l r a2 a1
P2 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: P2 l r a2 a1 -> [P2 l r a2 a1]
shrink (P2 l a2 a1
x r a2 a1
y) = forall k2 k1 (l :: k2 -> k1 -> *) (r :: k2 -> k1 -> *) (a2 :: k2)
       (a1 :: k1).
l a2 a1 -> r a2 a1 -> P2 l r a2 a1
P2 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a2 a1
x forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => a -> [a]
QC.shrink r a2 a1
y
instance (QC.Arbitrary (l a3 a2 a1), QC.Arbitrary (r a3 a2 a1)) => QC.Arbitrary (P3 l r a3 a2 a1) where
  arbitrary :: Gen (P3 l r a3 a2 a1)
arbitrary = forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
l a3 a2 a1 -> r a3 a2 a1 -> P3 l r a3 a2 a1
P3 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: P3 l r a3 a2 a1 -> [P3 l r a3 a2 a1]
shrink (P3 l a3 a2 a1
x r a3 a2 a1
y) = forall k3 k2 k1 (l :: k3 -> k2 -> k1 -> *)
       (r :: k3 -> k2 -> k1 -> *) (a3 :: k3) (a2 :: k2) (a1 :: k1).
l a3 a2 a1 -> r a3 a2 a1 -> P3 l r a3 a2 a1
P3 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a3 a2 a1
x forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => a -> [a]
QC.shrink r a3 a2 a1
y
instance (QC.Arbitrary (l a4 a3 a2 a1), QC.Arbitrary (r a4 a3 a2 a1)) => QC.Arbitrary (P4 l r a4 a3 a2 a1) where
  arbitrary :: Gen (P4 l r a4 a3 a2 a1)
arbitrary = forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
l a4 a3 a2 a1 -> r a4 a3 a2 a1 -> P4 l r a4 a3 a2 a1
P4 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
QC.arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
QC.arbitrary
  shrink :: P4 l r a4 a3 a2 a1 -> [P4 l r a4 a3 a2 a1]
shrink (P4 l a4 a3 a2 a1
x r a4 a3 a2 a1
y) = forall k4 k3 k2 k1 (l :: k4 -> k3 -> k2 -> k1 -> *)
       (r :: k4 -> k3 -> k2 -> k1 -> *) (a4 :: k4) (a3 :: k3) (a2 :: k2)
       (a1 :: k1).
l a4 a3 a2 a1 -> r a4 a3 a2 a1 -> P4 l r a4 a3 a2 a1
P4 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => a -> [a]
QC.shrink l a4 a3 a2 a1
x forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => a -> [a]
QC.shrink r a4 a3 a2 a1
y