packages feed

arithmoi 0.11.0.0 → 0.11.0.1

raw patch · 8 files changed

+33/−27 lines, 8 filesdep ~randomdep ~smallcheckPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: random, smallcheck

API changes (from Hackage documentation)

Files

arithmoi.cabal view
@@ -1,5 +1,5 @@ name:          arithmoi-version:       0.11.0.0+version:       0.11.0.1 cabal-version: >=1.10 build-type:    Simple license:       MIT@@ -39,7 +39,7 @@     integer-logarithms >=1.0,     integer-roots >=1.0,     mod,-    random >=1.0 && <1.2,+    random >=1.0 && <1.3,     transformers >=0.4 && <0.6,     semirings >=0.5.2,     vector >=0.12@@ -124,7 +124,7 @@     QuickCheck >=2.10,     quickcheck-classes >=0.6.3,     semirings >=0.2,-    smallcheck >=1.1.3 && <1.2,+    smallcheck >=1.2 && <1.3,     tasty >=0.10,     tasty-hunit >=0.9 && <0.11,     tasty-quickcheck >=0.9 && <0.11,
changelog.md view
@@ -1,5 +1,11 @@ # Changelog +## 0.11.0.1++### Changed++* Switch to `smallcheck-1.2.0`.+ ## 0.11.0.0  ### Added
test-suite/Math/NumberTheory/CurvesTests.hs view
@@ -14,7 +14,7 @@ module Math.NumberTheory.CurvesTests where  import Test.Tasty-import Test.Tasty.QuickCheck as QC hiding (Positive, NonNegative, generate, getNonNegative)+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonNegative(..))  import GHC.TypeNats (KnownNat) 
test-suite/Math/NumberTheory/EisensteinIntegersTests.hs view
@@ -17,7 +17,7 @@ import Data.Euclidean import Data.Maybe (fromJust, isJust) import Data.Proxy-import Test.Tasty.QuickCheck as QC hiding (Positive, getPositive, NonNegative, generate, getNonNegative)+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonNegative(..)) import Test.QuickCheck.Classes import Test.Tasty                                     (TestTree, testGroup) import Test.Tasty.HUnit                               (Assertion, assertEqual,
test-suite/Math/NumberTheory/EuclideanTests.hs view
@@ -21,7 +21,7 @@ import Prelude hiding (gcd) import Test.Tasty import Test.Tasty.HUnit-import Test.Tasty.QuickCheck as QC hiding (Positive(..))+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonZero(..))  import Control.Arrow import Data.Bits
test-suite/Math/NumberTheory/GaussianIntegersTests.hs view
@@ -19,7 +19,7 @@ import Data.List (groupBy, sort) import Data.Maybe (fromJust, mapMaybe) import Data.Proxy-import Test.Tasty.QuickCheck as QC hiding (Positive, getPositive, NonNegative, generate, getNonNegative)+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonNegative(..)) import Test.QuickCheck.Classes import Test.Tasty import Test.Tasty.HUnit
test-suite/Math/NumberTheory/TestUtils.hs view
@@ -49,11 +49,11 @@   ) where  import Test.QuickCheck.Classes-import Test.SmallCheck.Series (Positive(..), NonNegative(..), Serial(..), Series, generate, (\/), cons2)+import Test.SmallCheck.Series (Positive(..), NonNegative(..), NonZero(..), Serial(..), Series, generate, (\/), cons2) import Test.Tasty import Test.Tasty.HUnit       (Assertion, assertBool) import Test.Tasty.SmallCheck as SC-import Test.Tasty.QuickCheck as QC hiding (Positive, getPositive, NonNegative, generate, getNonNegative)+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonNegative(..), NonZero(..), generate)  import Data.Bits import Data.Euclidean
test-suite/Math/NumberTheory/TestUtils/Wrappers.hs view
@@ -31,8 +31,8 @@ import Data.Functor.Classes import Data.Semiring (Semiring) -import Test.Tasty.QuickCheck as QC hiding (Positive, NonNegative, generate, getNonNegative, getPositive)-import Test.SmallCheck.Series (Positive(..), NonNegative(..), Serial(..), Series)+import Test.Tasty.QuickCheck as QC hiding (Positive(..), NonNegative(..), NonZero(..))+import Test.SmallCheck.Series (Positive(..), NonNegative(..), NonZero(..), Serial(..), Series)  import Math.NumberTheory.Primes (Prime, UniqueFactorisation(..)) @@ -57,7 +57,6 @@ ------------------------------------------------------------------------------- -- Positive from smallcheck -deriving instance Functor Positive deriving instance Semiring a => Semiring (Positive a) deriving instance GcdDomain a => GcdDomain (Positive a) deriving instance Euclidean a => Euclidean (Positive a)@@ -66,10 +65,6 @@   arbitrary = Positive <$> (arbitrary `suchThat` (> 0))   shrink (Positive x) = Positive <$> filter (> 0) (shrink x) -instance (Num a, Bounded a) => Bounded (Positive a) where-  minBound = Positive 1-  maxBound = Positive (maxBound :: a)- instance Eq1 Positive where   liftEq eq (Positive a) (Positive b) = a `eq` b @@ -82,7 +77,6 @@ ------------------------------------------------------------------------------- -- NonNegative from smallcheck -deriving instance Functor NonNegative deriving instance Semiring a => Semiring (NonNegative a) deriving instance GcdDomain a => GcdDomain (NonNegative a) deriving instance Euclidean a => Euclidean (NonNegative a)@@ -91,10 +85,6 @@   arbitrary = NonNegative <$> (arbitrary `suchThat` (>= 0))   shrink (NonNegative x) = NonNegative <$> filter (>= 0) (shrink x) -instance (Num a, Bounded a) => Bounded (NonNegative a) where-  minBound = NonNegative 0-  maxBound = NonNegative (maxBound :: a)- instance Eq1 NonNegative where   liftEq eq (NonNegative a) (NonNegative b) = a `eq` b @@ -105,14 +95,24 @@   liftShowsPrec shw _ p (NonNegative a) = shw p a  ---------------------------------------------------------------------------------- NonZero from QuickCheck+-- NonZero from smallcheck -instance (Monad m, Num a, Eq a, Serial m a) => Serial m (NonZero a) where-  series = NonZero <$> series `suchThatSerial` (/= 0)+deriving instance Semiring a => Semiring (NonZero a)+deriving instance GcdDomain a => GcdDomain (NonZero a)+deriving instance Euclidean a => Euclidean (NonZero a) -instance (Eq a, Num a, Enum a, Bounded a) => Bounded (NonZero a) where-  minBound = if minBound == (0 :: a) then NonZero (succ minBound) else NonZero minBound-  maxBound = if maxBound == (0 :: a) then NonZero (pred maxBound) else NonZero maxBound+instance (Num a, Ord a, Arbitrary a) => Arbitrary (NonZero a) where+  arbitrary = NonZero <$> (arbitrary `suchThat` (/= 0))+  shrink (NonZero x) = NonZero <$> filter (/= 0) (shrink x)++instance Eq1 NonZero where+  liftEq eq (NonZero a) (NonZero b) = a `eq` b++instance Ord1 NonZero where+  liftCompare cmp (NonZero a) (NonZero b) = a `cmp` b++instance Show1 NonZero where+  liftShowsPrec shw _ p (NonZero a) = shw p a  ------------------------------------------------------------------------------- -- Huge