packages feed

arithmoi 0.12.0.2 → 0.12.1.0

raw patch · 23 files changed

+34/−23 lines, 23 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Math.NumberTheory.Moduli.Multiplicative: instance GHC.TypeNats.KnownNat m => GHC.Show.Show (Math.NumberTheory.Moduli.Multiplicative.MultMod m)
- Math.NumberTheory.Moduli.Multiplicative: instance GHC.TypeNats.KnownNat m => GHC.Show.Show (Math.NumberTheory.Moduli.Multiplicative.PrimitiveRoot m)
- Math.NumberTheory.Primes: instance GHC.Enum.Enum (Math.NumberTheory.Primes.Types.Prime GHC.Integer.Type.Integer)
- Math.NumberTheory.Primes: instance GHC.Enum.Enum (Math.NumberTheory.Primes.Types.Prime GHC.Natural.Natural)
- Math.NumberTheory.Primes: instance Math.NumberTheory.Primes.UniqueFactorisation GHC.Integer.Type.Integer
- Math.NumberTheory.Primes: instance Math.NumberTheory.Primes.UniqueFactorisation GHC.Natural.Natural
+ Math.NumberTheory.Moduli.Multiplicative: instance GHC.Show.Show (Math.NumberTheory.Moduli.Multiplicative.MultMod m)
+ Math.NumberTheory.Moduli.Multiplicative: instance GHC.Show.Show (Math.NumberTheory.Moduli.Multiplicative.PrimitiveRoot m)
+ Math.NumberTheory.Primes: instance GHC.Enum.Enum (Math.NumberTheory.Primes.Types.Prime GHC.Num.Integer.Integer)
+ Math.NumberTheory.Primes: instance GHC.Enum.Enum (Math.NumberTheory.Primes.Types.Prime GHC.Num.Natural.Natural)
+ Math.NumberTheory.Primes: instance Math.NumberTheory.Primes.UniqueFactorisation GHC.Num.Integer.Integer
+ Math.NumberTheory.Primes: instance Math.NumberTheory.Primes.UniqueFactorisation GHC.Num.Natural.Natural

Files

Math/NumberTheory/ArithmeticFunctions/Class.hs view
@@ -21,6 +21,7 @@ #if __GLASGOW_HASKELL__ < 803 import Data.Semigroup #endif+import Prelude hiding (Applicative(..))  import Math.NumberTheory.Primes 
Math/NumberTheory/Primes/Counting/Impl.hs view
@@ -11,6 +11,8 @@ {-# LANGUAGE ScopedTypeVariables #-}  {-# OPTIONS_GHC -fspec-constr-count=24 #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}+ module Math.NumberTheory.Primes.Counting.Impl     ( primeCount     , primeCountMaxArg
Math/NumberTheory/Primes/Factorisation/Montgomery.hs view
@@ -181,12 +181,12 @@                 fmap mconcat $ forM cs $                   \(x, xm) -> if ptest x                               then pure $ singlePrimeFactor x xm-                              else repFact x b1 b2 (count - 1)+                              else fmap (modifyPowers (* xm)) (repFact x b1 b2 (count - 1))  data Factors = Factors   { _primeFactors     :: [(Integer, Word)]   , _compositeFactors :: [(Integer, Word)]-  }+  } deriving (Show)  singlePrimeFactor :: Integer -> Word -> Factors singlePrimeFactor a b = Factors [(a, b)] []
arithmoi.cabal view
@@ -1,5 +1,5 @@ name:          arithmoi-version:       0.12.0.2+version:       0.12.1.0 cabal-version: 2.0 build-type:    Simple license:       MIT@@ -17,7 +17,7 @@   powers (integer roots and tests, modular exponentiation). category:      Math, Algorithms, Number Theory author:        Andrew Lelechenko, Daniel Fischer-tested-with:   GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.4 GHC ==9.4.1+tested-with:   GHC ==8.2.2 GHC ==8.4.4 GHC ==8.6.5 GHC ==8.8.4 GHC ==8.10.7 GHC ==9.0.2 GHC ==9.2.5 GHC ==9.4.4 GHC ==9.6.1 extra-source-files:   changelog.md @@ -184,11 +184,8 @@     mod,     random,     semirings,+    tasty-bench,     vector-  build-depends:-    tasty-bench-  mixins:-    tasty-bench (Test.Tasty.Bench as Gauge.Main)   other-modules:     Math.NumberTheory.ArithmeticFunctionsBench     Math.NumberTheory.DiscreteLogarithmBench
benchmark/Bench.hs view
@@ -1,6 +1,6 @@ module Main where -import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.ArithmeticFunctionsBench as ArithmeticFunctions import Math.NumberTheory.DiscreteLogarithmBench as DiscreteLogarithm
benchmark/Math/NumberTheory/ArithmeticFunctionsBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench import Data.Set (Set)  import Math.NumberTheory.ArithmeticFunctions as A
benchmark/Math/NumberTheory/DiscreteLogarithmBench.hs view
@@ -11,7 +11,7 @@   , discreteLogarithm'   ) where -import Gauge.Main+import Test.Tasty.Bench import Control.Monad import Data.Maybe import Data.Mod
benchmark/Math/NumberTheory/EisensteinIntegersBench.hs view
@@ -6,7 +6,7 @@   ) where  import Data.Maybe-import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.ArithmeticFunctions (tau) import Math.NumberTheory.Primes (isPrime)
benchmark/Math/NumberTheory/GaussianIntegersBench.hs view
@@ -5,7 +5,7 @@   ) where  import Data.Maybe-import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.ArithmeticFunctions (tau) import Math.NumberTheory.Primes (isPrime)
benchmark/Math/NumberTheory/InverseBench.hs view
@@ -7,7 +7,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench import Data.Bits (Bits) import Data.Euclidean import Numeric.Natural
benchmark/Math/NumberTheory/JacobiBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench import Numeric.Natural  import Math.NumberTheory.Moduli.Sqrt
benchmark/Math/NumberTheory/MertensBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.ArithmeticFunctions.Mertens 
benchmark/Math/NumberTheory/PrimesBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench import System.Random  import Math.NumberTheory.Logarithms (integerLog2)
benchmark/Math/NumberTheory/PrimitiveRootsBench.hs view
@@ -6,7 +6,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench import Data.Constraint import Data.Maybe 
benchmark/Math/NumberTheory/RecurrencesBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench  import Data.Euclidean (GcdDomain) import Math.NumberTheory.Recurrences
benchmark/Math/NumberTheory/SequenceBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench  import Data.Array.Unboxed import Data.Bits
benchmark/Math/NumberTheory/SieveBlockBench.hs view
@@ -7,7 +7,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench #if __GLASGOW_HASKELL__ < 803 import Data.Semigroup #endif
benchmark/Math/NumberTheory/SmoothNumbersBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.Primes import Math.NumberTheory.SmoothNumbers
benchmark/Math/NumberTheory/ZetaBench.hs view
@@ -4,7 +4,7 @@   ( benchSuite   ) where -import Gauge.Main+import Test.Tasty.Bench  import Math.NumberTheory.Zeta 
changelog.md view
@@ -1,5 +1,11 @@ # Changelog +## 0.12.1.0++### Fixed++* Fix a grave bug in prime factorisation, lurking since `arithmoi-0.7.0.0`.+ ## 0.12.0.2  ### Fixed
test-suite/Math/NumberTheory/GaussianIntegersTests.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-type-defaults #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}  -- | -- Module:      Math.NumberTheory.GaussianIntegersTests
test-suite/Math/NumberTheory/Moduli/SqrtTests.hs view
@@ -11,6 +11,7 @@ {-# LANGUAGE ViewPatterns    #-}  {-# OPTIONS_GHC -fno-warn-type-defaults #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}  module Math.NumberTheory.Moduli.SqrtTests   ( testSuite
test-suite/Math/NumberTheory/Primes/FactorisationTests.hs view
@@ -57,6 +57,9 @@   -- , (16757651897802863152387219654541878166,[(2,1),(23,1),(277,1),(505353699591289,1),(2602436338718275457,1)])   , ((10 ^ 80 - 1) `div` 9, [(11,1),(17,1),(41,1),(73,1),(101,1),(137,1),(271,1),(3541,1),(9091,1),(27961,1),                              (1676321,1),(5070721,1),(5882353,1),(5964848081,1),(19721061166646717498359681,1)])+  , (623506907396924300595652906937, [(300137,1),(825131,2),(1746779,2)])+  , (626472835738582668418814215862, [(2,1),(150211,1),(11746151,2),(122939,2)])+  , (638396704483535474833679624037, [(3,1),(11,2),(100519,1),(104281,2),(1268419,2)])   ]  lazyCases :: [(Integer, [(Integer, Word)])]