quickcheck-classes 0.4.14.1 → 0.4.14.2
raw patch · 21 files changed
+85/−19 lines, 21 filesdep ~QuickCheckdep ~containers
Dependency ranges changed: QuickCheck, containers
Files
- changelog.md +6/−0
- quickcheck-classes.cabal +2/−2
- src/Test/QuickCheck/Classes.hs +1/−1
- src/Test/QuickCheck/Classes/Alt.hs +2/−0
- src/Test/QuickCheck/Classes/Alternative.hs +3/−1
- src/Test/QuickCheck/Classes/Applicative.hs +3/−1
- src/Test/QuickCheck/Classes/Apply.hs +2/−0
- src/Test/QuickCheck/Classes/Bifunctor.hs +3/−1
- src/Test/QuickCheck/Classes/Category.hs +3/−1
- src/Test/QuickCheck/Classes/Common.hs +12/−1
- src/Test/QuickCheck/Classes/Foldable.hs +3/−1
- src/Test/QuickCheck/Classes/Functor.hs +3/−1
- src/Test/QuickCheck/Classes/IsList.hs +15/−2
- src/Test/QuickCheck/Classes/Monad.hs +3/−1
- src/Test/QuickCheck/Classes/MonadFail.hs +3/−1
- src/Test/QuickCheck/Classes/MonadPlus.hs +3/−1
- src/Test/QuickCheck/Classes/MonadZip.hs +3/−1
- src/Test/QuickCheck/Classes/Plus.hs +2/−0
- src/Test/QuickCheck/Classes/Semigroupoid.hs +3/−1
- src/Test/QuickCheck/Classes/Traversable.hs +3/−1
- test/Spec.hs +7/−1
changelog.md view
@@ -4,6 +4,12 @@ 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.4.14.2] - 2018-09-12+### Change+- Support QuickCheck-2.12+- Fix compilation for containers<0.5.9+- Fix compilation with QuickCheck-2.9+ ## [0.4.14.1] - 2018-07-24 ### Change - Build correctly when dependency on semigroupoids is disabled.
quickcheck-classes.cabal view
@@ -1,5 +1,5 @@ name: quickcheck-classes-version: 0.4.14.1+version: 0.4.14.2 synopsis: QuickCheck common typeclasses description: This library provides QuickCheck properties to ensure@@ -86,7 +86,7 @@ , QuickCheck >= 2.9 , transformers >= 0.3 && < 0.6 , primitive >= 0.6.1 && < 0.7- , containers+ , containers >= 0.5 , semigroups , tagged if flag(aeson)
src/Test/QuickCheck/Classes.hs view
@@ -247,7 +247,7 @@ putStr (typeClassName ++ ": " ++ name ++ " ") r <- quickCheckResult p return $ case r of- Success _ _ _ -> Good+ Success{} -> Good _ -> Bad putStrLn "" case r of
src/Test/QuickCheck/Classes/Alt.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Alt (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) #if defined(VERSION_semigroupoids) altLaws+#endif #endif #endif ) where
src/Test/QuickCheck/Classes/Alternative.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Alternative (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) alternativeLaws-#endif +#endif+#endif ) where import Control.Applicative (Alternative(..))
src/Test/QuickCheck/Classes/Applicative.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Applicative (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) applicativeLaws-#endif +#endif+#endif ) where import Control.Applicative
src/Test/QuickCheck/Classes/Apply.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Apply (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) #if defined(VERSION_semigroupoids) applyLaws+#endif #endif #endif ) where
src/Test/QuickCheck/Classes/Bifunctor.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Bifunctor (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0) bifunctorLaws-#endif +#endif+#endif ) where import Data.Bifunctor(Bifunctor(..))
src/Test/QuickCheck/Classes/Category.hs view
@@ -5,10 +5,12 @@ module Test.QuickCheck.Classes.Category (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0) categoryLaws , commutativeCategoryLaws-#endif +#endif+#endif ) where import Prelude hiding (id, (.))
src/Test/QuickCheck/Classes/Common.hs view
@@ -18,7 +18,7 @@ , LastNothing(..) , Bottom(..) , LinearEquation(..)-#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)+#if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0) , LinearEquationM(..) #endif , QuadraticEquation(..)@@ -186,11 +186,16 @@ #endif #endif +#if MIN_VERSION_QuickCheck(2,10,0) instance Arbitrary1 Triple where liftArbitrary x = Triple <$> x <*> x <*> x instance Arbitrary a => Arbitrary (Triple a) where arbitrary = liftArbitrary arbitrary+#else+instance Arbitrary a => Arbitrary (Triple a) where+ arbitrary = Triple <$> arbitrary <*> arbitrary <*> arbitrary+#endif instance Functor Triple where fmap f (Triple a b c) = Triple (f a) (f b) (f c)@@ -274,10 +279,12 @@ instance (Show1 f, Show a) => Show (Apply f a) where showsPrec p = showsPrec1 p . getApply +#if MIN_VERSION_QuickCheck(2,10,0) instance (Arbitrary1 f, Arbitrary a) => Arbitrary (Apply f a) where arbitrary = fmap Apply arbitrary1 shrink = map Apply . shrink1 . getApply #endif+#endif foldMapA :: (Foldable t, Monoid m, Semigroup m, Applicative f) => (a -> f m) -> t a -> f m foldMapA f = getApply . foldMap (Apply . f)@@ -292,10 +299,12 @@ instance (Show2 f, Show a, Show b) => Show (Apply2 f a b) where showsPrec p = showsPrec2 p . getApply2 +#if MIN_VERSION_QuickCheck(2,10,0) instance (Arbitrary2 f, Arbitrary a, Arbitrary b) => Arbitrary (Apply2 f a b) where arbitrary = fmap Apply2 arbitrary2 shrink = fmap Apply2 . shrink2 . getApply2 #endif+#endif data LinearEquation = LinearEquation { _linearEquationLinear :: Integer@@ -336,12 +345,14 @@ . showString " else " . showsPrec1 0 b +#if MIN_VERSION_QuickCheck(2,10,0) instance Arbitrary1 m => Arbitrary (LinearEquationM m) where arbitrary = liftA2 LinearEquationM arbitrary1 arbitrary1 shrink (LinearEquationM a b) = L.concat [ map (\x -> LinearEquationM x b) (shrink1 a) , map (\x -> LinearEquationM a x) (shrink1 b) ]+#endif #endif instance Arbitrary LinearEquation where
src/Test/QuickCheck/Classes/Foldable.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Foldable (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) foldableLaws-#endif +#endif+#endif ) where import Data.Monoid
src/Test/QuickCheck/Classes/Functor.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Functor (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) functorLaws-#endif +#endif+#endif ) where import Data.Functor
src/Test/QuickCheck/Classes/IsList.hs view
@@ -53,8 +53,13 @@ import Data.Proxy (Proxy) import Data.Foldable (foldlM) import Data.Traversable (traverse)-import Test.QuickCheck (Property,Arbitrary,Function,CoArbitrary,(===),property,- applyFun,applyFun2,NonNegative(..),Fun)+import Test.QuickCheck (Property,Arbitrary,CoArbitrary,(===),property,+ NonNegative(..))+#if MIN_VERSION_QuickCheck(2,10,0)+import Test.QuickCheck.Function (Function,Fun,applyFun,applyFun2)+#else+import Test.QuickCheck.Function (Function,Fun,apply)+#endif import qualified Data.List as L import Test.QuickCheck.Classes.Common (Laws(..), myForAllShrink)@@ -235,4 +240,12 @@ stApplyFun2 :: Fun (a,b) c -> a -> b -> ST s c stApplyFun2 f a b = return (applyFun2 f a b)++#if !MIN_VERSION_QuickCheck(2,10,0)+applyFun :: Fun a b -> (a -> b)+applyFun = apply++applyFun2 :: Fun (a, b) c -> (a -> b -> c)+applyFun2 = curry . apply+#endif #endif
src/Test/QuickCheck/Classes/Monad.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Monad (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) monadLaws-#endif +#endif+#endif ) where import Control.Applicative
src/Test/QuickCheck/Classes/MonadFail.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.MonadFail (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) && MIN_VERSION_transformers(0,4,0) monadFailLaws-#endif +#endif+#endif ) where import Control.Applicative
src/Test/QuickCheck/Classes/MonadPlus.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.MonadPlus (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) monadPlusLaws-#endif +#endif+#endif ) where import Test.QuickCheck hiding ((.&.))
src/Test/QuickCheck/Classes/MonadZip.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.MonadZip (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) monadZipLaws-#endif +#endif+#endif ) where import Control.Applicative
src/Test/QuickCheck/Classes/Plus.hs view
@@ -5,10 +5,12 @@ module Test.QuickCheck.Classes.Plus (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) #if defined(VERSION_semigroupoids) plusLaws , extendedPlusLaws+#endif #endif #endif ) where
src/Test/QuickCheck/Classes/Semigroupoid.hs view
@@ -5,12 +5,14 @@ module Test.QuickCheck.Classes.Semigroupoid (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,5,0) #if defined(VERSION_semigroupoids) semigroupoidLaws , commutativeSemigroupoidLaws #endif-#endif +#endif+#endif ) where import Prelude hiding (id, (.))
src/Test/QuickCheck/Classes/Traversable.hs view
@@ -5,9 +5,11 @@ module Test.QuickCheck.Classes.Traversable (+#if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) traversableLaws-#endif +#endif+#endif ) where import Data.Foldable (foldMap)
test/Spec.hs view
@@ -45,7 +45,11 @@ main :: IO () main = do+#if defined(VERSION_semigroupoids)+#if MIN_VERSION_containers(0,5,9) quickCheck prop_map_apply_equals+#endif+#endif lawsCheckMany allPropsApplied allPropsApplied :: [(String,[Laws])]@@ -62,11 +66,13 @@ #if MIN_VERSION_QuickCheck(2,10,0) #if MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0) #if defined(VERSION_semigroupoids)+#if MIN_VERSION_containers(0,5,9) , ("Map", someHigherLaws (Proxy1 :: Proxy1 (Map Int))) , ("Pound", someHigherLaws (Proxy1 :: Proxy1 (Pound Int))) #endif #endif #endif+#endif #if MIN_VERSION_base(4,7,0) , ("Vector",[isListLaws (Proxy :: Proxy (Vector Word))]) #endif@@ -158,7 +164,7 @@ #endif newtype Pound k v = Pound { getPound :: Map k v }-#if MIN_VERSION_QuickCheck(2,10,0) && (MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0))+#if MIN_VERSION_QuickCheck(2,10,0) && (MIN_VERSION_base(4,9,0) || MIN_VERSION_transformers(0,4,0)) && MIN_VERSION_containers(0,5,9) deriving (Eq,Functor,Show,Arbitrary,Arbitrary1,Eq1,Show1) #else deriving (Eq,Show,Arbitrary)