quickcheck-classes 0.6.4.0 → 0.6.5.0
raw patch · 4 files changed
+53/−22 lines, 4 filesdep −bifunctorsdep −contravariantdep ~base-orphansdep ~primitivedep ~quickcheck-classes-base
Dependencies removed: bifunctors, contravariant
Dependency ranges changed: base-orphans, primitive, quickcheck-classes-base, transformers
Files
- changelog.md +14/−2
- quickcheck-classes.cabal +15/−15
- src/Test/QuickCheck/Classes.hs +2/−1
- test/Spec.hs +22/−4
changelog.md view
@@ -4,9 +4,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). -## [0.6.4.0] - 2019-09-13+Note that since `quickcheck-classes` reexports larges parts of+`quickcheck-classes-base`, changelog entries that deal with any of the+classes from `base` are duplicated across the two changelogs.++## [0.6.5.0] - 2021-04-12 ### Added-- laws for `abs` and `signum`+- Laws for `abs` and `signum`+- Storable Set-Set Law (resolves issue 101).+- Add laws for `quotRem` and `divMod`.+- Use non-commutative monoid for bifoldable tests (resolves issue 98)+- `substitutiveEqLaws`, which tests for Eq substitutivity.+- Negation law check for `Eq`.+- Document that users can provide their own `Laws`.++## [0.6.4.0] - 2019-09-13 ### Changed - Use newer semirings
quickcheck-classes.cabal view
@@ -1,5 +1,6 @@+cabal-version: 2.4 name: quickcheck-classes-version: 0.6.4.0+version: 0.6.5.0 synopsis: QuickCheck common typeclasses description: This library provides QuickCheck properties to ensure@@ -14,7 +15,7 @@ but on GHC >= 8.5, it uses `-XQuantifiedConstraints` to express these constraints more cleanly. homepage: https://github.com/andrewthad/quickcheck-classes#readme-license: BSD3+license: BSD-3-Clause license-file: LICENSE author: Andrew Martin, chessai maintainer: andrew.thaddeus@gmail.com@@ -22,7 +23,6 @@ category: Testing build-type: Simple extra-source-files: README.md-cabal-version: >=1.10 extra-source-files: changelog.md flag aeson@@ -92,31 +92,31 @@ Test.QuickCheck.Classes.Semiring Test.QuickCheck.Classes.Ring build-depends:- base >= 4.5 && < 5- , base-orphans >= 0.1- , bifunctors- , contravariant+ , base >= 4.5 && < 5 , QuickCheck >= 2.7 , transformers >= 0.3 && < 0.6 , primitive >= 0.6.4 && < 0.8 , primitive-addr >= 0.1.0.2 && < 0.2 , containers >= 0.4.2.1- , semigroups >= 0.17- , tagged- , fail- , quickcheck-classes-base >=0.6 && <0.7+ , quickcheck-classes-base >=0.6.2 && <0.7+ if impl(ghc < 8.0)+ build-depends:+ , semigroups >= 0.17+ , fail+ if impl(ghc < 7.8)+ build-depends: tagged if impl(ghc > 7.4) && impl(ghc < 7.6) build-depends: ghc-prim if impl(ghc > 8.5) cpp-options: -DHAVE_QUANTIFIED_CONSTRAINTS if flag(unary-laws) build-depends:- transformers >= 0.4.0+ , transformers >= 0.4.0 , QuickCheck >= 2.10.0 cpp-options: -DHAVE_UNARY_LAWS if flag(binary-laws) build-depends:- transformers >= 0.5.0+ , transformers >= 0.5.0 , QuickCheck >= 2.10.0 cpp-options: -DHAVE_BINARY_LAWS if flag(aeson)@@ -142,7 +142,7 @@ other-modules: Spec.ShowRead build-depends:- base+ , base , base-orphans >= 0.5 , quickcheck-classes , QuickCheck@@ -179,7 +179,7 @@ main-is: Advanced.hs ghc-options: -O2 build-depends:- QuickCheck+ , QuickCheck , base >= 4.12 , base-orphans >= 0.5 , containers
src/Test/QuickCheck/Classes.hs view
@@ -22,6 +22,7 @@ , QCB.bitsLaws #endif , QCB.eqLaws+ , QCB.substitutiveEqLaws , QCB.numLaws , QCB.integralLaws , QCB.ixLaws@@ -80,7 +81,7 @@ -- ** Binary type constructors , QCB.bifoldableLaws , QCB.bifunctorLaws- , QCB.bitraversableLaws + , QCB.bitraversableLaws , QCB.categoryLaws , QCB.commutativeCategoryLaws #if HAVE_SEMIGROUPOIDS
test/Spec.hs view
@@ -27,6 +27,9 @@ #if HAVE_SEMIGROUPOIDS import Data.Functor.Apply (Apply((<.>))) #endif+#if HAVE_BINARY_LAWS+import Data.Functor.Const (Const(..))+#endif #if HAVE_UNARY_LAWS import Data.Functor.Classes #endif@@ -61,8 +64,23 @@ [ ("Int",allLaws (Proxy :: Proxy Int)) , ("Int64",allLaws (Proxy :: Proxy Int64)) , ("Word",allLaws (Proxy :: Proxy Word))- , ("Tuple",[bitraversableLaws (Proxy :: Proxy (,))])- , ("Either",[bitraversableLaws (Proxy :: Proxy Either)])+#if HAVE_BINARY_LAWS+ , ("Tuple"+ , [ bitraversableLaws (Proxy :: Proxy (,))+ , bifoldableLaws (Proxy :: Proxy (,))+ ]+ )+ , ("Const"+ , [ bifoldableLaws (Proxy :: Proxy Const)+ , bitraversableLaws (Proxy :: Proxy Const)+ ]+ )+ , ("Either"+ , [ bitraversableLaws (Proxy :: Proxy Either)+ , bifoldableLaws (Proxy :: Proxy Either)+ ]+ )+#endif #if HAVE_UNARY_LAWS , ("Maybe",allHigherLaws (Proxy1 :: Proxy1 Maybe)) , ("List",allHigherLaws (Proxy1 :: Proxy1 []))@@ -105,7 +123,7 @@ , FiniteBits a #endif ) => Proxy a -> [Laws]-allLaws p = +allLaws p = [ primLaws p , storableLaws p , semigroupLaws (Proxy :: Proxy (Sum a))@@ -176,7 +194,7 @@ ) -- Note: when using base < 4.6, the Rogue type does--- not really test anything. +-- not really test anything. instance Foldable Rogue where foldMap f (Rogue xs) = F.foldMap f xs foldl f x (Rogue xs) = F.foldl f x xs