@@ -731,12 +731,24 @@ instance Arbitrary FieldName where
731 shrink = genericShrink
731 shrink = genericShrink
734+#if MIN_VERSION_base(4,10,0)
735+-- Test.QuickCheck.Modifiers
737+qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
738+qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
739+qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
741+instance Arbitrary a => Arbitrary (NonEmpty a) where
742+ arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
734instance Arbitrary RegexpFlags where
745instance Arbitrary RegexpFlags where
735 arbitrary = oneof [ pure AllRegexpFlags
746 arbitrary = oneof [ pure AllRegexpFlags
736 , pure NoRegexpFlags
747 , pure NoRegexpFlags
737 , SomeRegexpFlags <$> genUniqueFlags
748 , SomeRegexpFlags <$> genUniqueFlags
739 where genUniqueFlags = NE.fromList . nub <$> listOf1 arbitrary
750 where genUniqueFlags = NE.fromList . nub <$> listOf1 arbitrary
740 shrink = genericShrink
752 shrink = genericShrink