quickcheck-monoid-subclasses 0.3.0.5 → 0.3.0.6
raw patch · 4 files changed
+54/−17 lines, 4 filesdep −quickcheck-instancesdep ~QuickCheckPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependencies removed: quickcheck-instances
Dependency ranges changed: QuickCheck
API changes (from Hackage documentation)
+ Internal.Prelude: A :: Variable
+ Internal.Prelude: B :: Variable
+ Internal.Prelude: BindingSet :: s -> s -> s -> s -> BindingSet s
+ Internal.Prelude: C :: Variable
+ Internal.Prelude: D :: Variable
+ Internal.Prelude: Tuple1 :: VariableSum -> BindingSet s -> Tuple1 s
+ Internal.Prelude: Tuple2 :: VariableSum -> VariableSum -> BindingSet s -> Tuple2 s
+ Internal.Prelude: Tuple3 :: VariableSum -> VariableSum -> VariableSum -> BindingSet s -> Tuple3 s
+ Internal.Prelude: VariableSum :: NonEmpty Variable -> VariableSum
+ Internal.Prelude: [bindingForA] :: BindingSet s -> s
+ Internal.Prelude: [bindingForB] :: BindingSet s -> s
+ Internal.Prelude: [bindingForC] :: BindingSet s -> s
+ Internal.Prelude: [bindingForD] :: BindingSet s -> s
+ Internal.Prelude: a :: VariableSum
+ Internal.Prelude: allNonNull :: (Eq a, Semigroup a, Foldable f) => f a -> Bool
+ Internal.Prelude: allUnique :: (Eq a, Foldable f) => f a -> Bool
+ Internal.Prelude: allUniqueNonNull :: (Eq a, Foldable f, Semigroup a) => f a -> Bool
+ Internal.Prelude: b :: VariableSum
+ Internal.Prelude: bindVariable :: BindingSet s -> Variable -> s
+ Internal.Prelude: bindVariableSum :: BindingSet s -> VariableSum -> NonEmpty s
+ Internal.Prelude: c :: VariableSum
+ Internal.Prelude: d :: VariableSum
+ Internal.Prelude: data BindingSet s
+ Internal.Prelude: data Tuple1 s
+ Internal.Prelude: data Tuple2 s
+ Internal.Prelude: data Tuple3 s
+ Internal.Prelude: data Variable
+ Internal.Prelude: evalTuple1 :: Semigroup s => Tuple1 s -> s
+ Internal.Prelude: evalTuple2 :: Semigroup s => Tuple2 s -> (s, s)
+ Internal.Prelude: evalTuple3 :: Semigroup s => Tuple3 s -> (s, s, s)
+ Internal.Prelude: evalVariableSum :: Semigroup s => BindingSet s -> VariableSum -> s
+ Internal.Prelude: genBindingSet :: Arbitrary s => Gen (BindingSet s)
+ Internal.Prelude: genTuple1 :: Arbitrary a => Gen (Tuple1 a)
+ Internal.Prelude: genTuple2 :: Arbitrary a => Gen (Tuple2 a)
+ Internal.Prelude: genTuple3 :: Arbitrary a => Gen (Tuple3 a)
+ Internal.Prelude: genVariableSum :: Gen VariableSum
+ Internal.Prelude: newtype VariableSum
+ Internal.Prelude: showTuple1 :: (Semigroup a, Show a) => Tuple1 a -> String
+ Internal.Prelude: showTuple2 :: (Semigroup a, Show a) => Tuple2 a -> String
+ Internal.Prelude: showTuple3 :: (Semigroup a, Show a) => Tuple3 a -> String
+ Internal.Prelude: showVariableSum :: Show s => BindingSet s -> VariableSum -> String
+ Internal.Prelude: showWrap :: Show a => a -> String
+ Internal.Prelude: shrinkBindingSet :: Arbitrary s => BindingSet s -> [BindingSet s]
+ Internal.Prelude: shrinkTuple1 :: Arbitrary a => Tuple1 a -> [Tuple1 a]
+ Internal.Prelude: shrinkTuple2 :: Arbitrary a => Tuple2 a -> [Tuple2 a]
+ Internal.Prelude: shrinkTuple3 :: Arbitrary a => Tuple3 a -> [Tuple3 a]
+ Internal.Prelude: universe :: (Bounded a, Enum a) => [a]
Files
- CHANGELOG.md +4/−0
- quickcheck-monoid-subclasses.cabal +2/−6
- src/prelude/Internal/Prelude.hs +0/−2
- src/test/ClassSpec.hs +48/−9
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.3.0.6++- Revised upper bounds for package dependencies.+ # 0.3.0.5 - Added support for GHC `9.12`.
quickcheck-monoid-subclasses.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: quickcheck-monoid-subclasses-version: 0.3.0.5+version: 0.3.0.6 bug-reports: https://github.com/jonathanknowles/quickcheck-monoid-subclasses/issues license: Apache-2.0 license-file: LICENSE@@ -33,11 +33,9 @@ common dependency-pretty-show build-depends:pretty-show >= 1.10 && < 1.11 common dependency-QuickCheck- build-depends:QuickCheck >= 2.14.2 && < 2.16+ build-depends:QuickCheck >= 2.14.2 && < 2.17 common dependency-quickcheck-classes build-depends:quickcheck-classes >= 0.6.5.0 && < 0.7-common dependency-quickcheck-instances- build-depends:quickcheck-instances >= 0.3.28 && < 0.4 common dependency-semigroupoids build-depends:semigroupoids >= 5.3.7 && < 6.1 common dependency-text@@ -109,7 +107,6 @@ , dependency-monoid-subclasses , dependency-QuickCheck , dependency-quickcheck-classes- , dependency-quickcheck-instances , extensions build-depends: , internal@@ -131,7 +128,6 @@ , dependency-monoid-subclasses , dependency-QuickCheck , dependency-quickcheck-classes- , dependency-quickcheck-instances , dependency-text , dependency-vector , extensions
src/prelude/Internal/Prelude.hs view
@@ -26,5 +26,3 @@ import Internal.Semigroup.Tuple import Numeric.Natural import Test.QuickCheck-import Test.QuickCheck.Instances.Natural- ()
src/test/ClassSpec.hs view
@@ -49,7 +49,16 @@ import Test.Hspec.Laws ( testLawsMany ) import Test.QuickCheck- ( Arbitrary (..), Confidence, Property, scale, shrinkMap )+ ( Arbitrary (..)+ , Confidence+ , Property+ , elements+ , frequency+ , listOf+ , scale+ , shrinkIntegral+ , shrinkMap+ ) import Test.QuickCheck.Classes ( Laws (..) ) import Test.QuickCheck.Classes.Monoid.Factorial@@ -80,17 +89,13 @@ ) import Test.QuickCheck.Classes.Semigroup.Factorial ( factorialLaws, stableFactorialLaws )-import Test.QuickCheck.Instances.ByteString- ()-import Test.QuickCheck.Instances.Natural- ()-import Test.QuickCheck.Instances.Text- ()-import Test.QuickCheck.Instances.Vector- () import Test.QuickCheck.Property ( Result (..), mapTotalResult ) +import qualified Data.ByteString.Lazy as ByteString+import qualified Data.Text as Text+import qualified Data.Vector as Vector+ spec :: Spec spec = do testLawsMany @() $ fmap disableCoverageCheck <$>@@ -551,9 +556,43 @@ , SumCancellative ) +--------------------------------------------------------------------------------+-- Arbitrary instances+--------------------------------------------------------------------------------+ instance Arbitrary a => Arbitrary (Small a) where arbitrary = Small <$> scale (`div` 2) arbitrary shrink = shrinkMap Small getSmall++instance Arbitrary ByteString where+ arbitrary = ByteString.pack <$> listOf genByte+ where+ genByte = frequency+ [ (64, pure 0)+ , (16, pure 1)+ , ( 4, pure 2)+ , ( 1, pure 3)+ ]+ shrink = shrinkMap ByteString.pack ByteString.unpack++instance Arbitrary Text where+ arbitrary = Text.pack <$> listOf genChar+ where+ genChar = frequency+ [ (64, pure 'a')+ , (16, pure 'b')+ , ( 4, pure 'c')+ , ( 1, pure 'd')+ ]+ shrink = shrinkMap Text.pack Text.unpack++instance Arbitrary Natural where+ arbitrary = elements [0 .. 3]+ shrink = shrinkIntegral++instance Arbitrary a => Arbitrary (Vector a) where+ arbitrary = Vector.fromList <$> arbitrary+ shrink = shrinkMap Vector.fromList Vector.toList -------------------------------------------------------------------------------- -- Coverage checks