@@ -65,7 +65,10 @@ instance GArbitrary G.U1 where
6565 gArbitrary = pure G.U1
6666
6767instance Arbitrary c => GArbitrary (G.K1 i c) where
68− gArbitrary = G.K1 <$> arbitrary
68+ gArbitrary = G.K1 <$> scale predNat arbitrary
69+ where
70+ predNat 0 = 0
71+ predNat n = pred n
6972
7073instance GArbitrary f => GArbitrary (G.M1 i c f) where
7174 gArbitrary = G.M1 <$> gArbitrary
@@ -82,8 +85,8 @@ type family SumLen a :: Nat where
8285instance (GArbitrary a, GArbitrary b, KnownNat (SumLen a), KnownNat (SumLen b)
8386 ) => GArbitrary (a G.:+: b) where
8487 gArbitrary = frequency
85− [ (lfreq, G.L1 <$> QC.scale pred gArbitrary)
86− , (rfreq, G.R1 <$> QC.scale pred gArbitrary) ]
88+ [ (lfreq, G.L1 <$> gArbitrary)
89+ , (rfreq, G.R1 <$> gArbitrary) ]
8790 where
8891 lfreq = fromIntegral $ natVal (Proxy :: Proxy (SumLen a))
8992 rfreq = fromIntegral $ natVal (Proxy :: Proxy (SumLen b))