git.iko.soy/typeable/bloodhound
on master help sign in
merge with upstream master
ecabdbeJosh Berman
stack-8.0.yaml+1−10
@@ -6,15 +6,6 @@ packages:
6- '.'
6- '.'
7- './examples'
7- './examples'
8extra-deps:
8extra-deps:
9−# - http-client-0.5.0
10−# - aeson-1.2.0.0
11−# - fail-4.9.0.0
12−# - http-types-0.9
13−# - attoparsec-0.13.0.1
14−- quickcheck-properties-0.1
9+ - quickcheck-properties-0.1
15−# - semigroups-0.18.3
16−# - uri-bytestring-0.1.9
17−# - temporary-resourcet-0.1.0.0
18−# - transformers-compat-0.5.1.4
19
10
20resolver: lts-8.14
11resolver: lts-8.14
tests/V1/tests.hs+11
@@ -719,6 +719,17 @@ instance Arbitrary FieldName where
719 shrink = genericShrink
719 shrink = genericShrink
720
720
721
721
722+#if MIN_VERSION_base(4,10,0)
723+-- Test.QuickCheck.Modifiers
724+
725+qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
726+qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
727+qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
728+
729+instance Arbitrary a => Arbitrary (NonEmpty a) where
730+ arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
731+#endif
732+
722instance Arbitrary RegexpFlags where
733instance Arbitrary RegexpFlags where
723 arbitrary = oneof [ pure AllRegexpFlags
734 arbitrary = oneof [ pure AllRegexpFlags
724 , pure NoRegexpFlags
735 , pure NoRegexpFlags
tests/V5/tests.hs+12
@@ -731,12 +731,24 @@ instance Arbitrary FieldName where
731 shrink = genericShrink
731 shrink = genericShrink
732
732
733
733
734+#if MIN_VERSION_base(4,10,0)
735+-- Test.QuickCheck.Modifiers
736+
737+qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
738+qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
739+qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
740+
741+instance Arbitrary a => Arbitrary (NonEmpty a) where
742+ arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
743+#endif
744+
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
738 ]
749 ]
739 where genUniqueFlags = NE.fromList . nub <$> listOf1 arbitrary
750 where genUniqueFlags = NE.fromList . nub <$> listOf1 arbitrary
751+
740 shrink = genericShrink
752 shrink = genericShrink
741
753
742
754