opentheory-prime 1.79 → 1.80
raw patch · 3 files changed
+60/−65 lines, 3 filesdep ~opentheorydep ~opentheory-dividesdep ~opentheory-primitivePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: opentheory, opentheory-divides, opentheory-primitive, opentheory-stream
API changes (from Hackage documentation)
Files
- opentheory-prime.cabal +15/−20
- src/Test.hs +45/−0
- testsrc/Main.hs +0/−45
opentheory-prime.cabal view
@@ -1,5 +1,5 @@ name: opentheory-prime-version: 1.79+version: 1.80 category: Number Theory synopsis: Prime natural numbers license: MIT@@ -10,36 +10,31 @@ maintainer: Joe Leslie-Hurd <joe@gilith.com> description: Prime natural numbers - this package was automatically generated from the- OpenTheory package natural-prime-1.79+ OpenTheory package natural-prime-1.80 library build-depends: base >= 4.0 && < 5.0, QuickCheck >= 2.4.0.1 && < 3.0,- opentheory-primitive >= 1.3 && < 2.0,- opentheory >= 1.193 && < 1.196,- opentheory-divides >= 1.53 && < 1.56,- opentheory-stream >= 1.42 && < 1.43-+ opentheory-primitive >= 1.4 && < 2.0,+ opentheory >= 1.193 && < 1.197,+ opentheory-divides >= 1.53 && < 1.57,+ opentheory-stream >= 1.42 && < 1.44 hs-source-dirs: src- ghc-options: -Wall- exposed-modules:- OpenTheory.Natural.Prime+ OpenTheory.Natural.Prime, OpenTheory.Natural.Prime.Sieve -executable opentheory-prime-test+test-suite opentheory-prime-test+ type: exitcode-stdio-1.0 build-depends: base >= 4.0 && < 5.0, QuickCheck >= 2.4.0.1 && < 3.0,- opentheory-primitive >= 1.3 && < 2.0,- opentheory >= 1.193 && < 1.196,- opentheory-divides >= 1.53 && < 1.56,- opentheory-stream >= 1.42 && < 1.43-- hs-source-dirs: src, testsrc-+ opentheory-primitive >= 1.4 && < 2.0,+ opentheory >= 1.193 && < 1.197,+ opentheory-divides >= 1.53 && < 1.57,+ opentheory-stream >= 1.42 && < 1.44+ hs-source-dirs: src ghc-options: -Wall-- main-is: Main.hs+ main-is: Test.hs
+ src/Test.hs view
@@ -0,0 +1,45 @@+{- |+module: Main+description: Prime natural numbers - testing+license: MIT++maintainer: Joe Leslie-Hurd <joe@gilith.com>+stability: provisional+portability: portable+-}+module Main+ ( main )+where++import qualified OpenTheory.Natural.Divides as Divides+import qualified OpenTheory.Natural.Prime as Prime+import qualified OpenTheory.Primitive.Natural as Natural+import qualified OpenTheory.Stream as Stream+import OpenTheory.Primitive.Test++assertion0 :: Bool+assertion0 = not (Stream.nth Prime.primes 0 == 0)++proposition0 :: Natural.Natural -> Natural.Natural -> Bool+proposition0 i j =+ (Stream.nth Prime.primes i <= Stream.nth Prime.primes j) == (i <= j)++proposition1 :: Natural.Natural -> Natural.Natural -> Bool+proposition1 i j =+ not+ (Divides.divides (Stream.nth Prime.primes i)+ (Stream.nth Prime.primes (i + (j + 1))))++proposition2 :: Natural.Natural -> Natural.Natural -> Bool+proposition2 n i =+ any (\p -> Divides.divides p (n + 2))+ (Stream.naturalTake Prime.primes i) ||+ Stream.nth Prime.primes i <= n + 2++main :: IO ()+main =+ do assert "Assertion 0:\n ~(nth Prime.all 0 = 0)\n " assertion0+ check "Proposition 0:\n !i j. nth Prime.all i <= nth Prime.all j <=> i <= j\n " proposition0+ check "Proposition 1:\n !i j. ~divides (nth Prime.all i) (nth Prime.all (i + (j + 1)))\n " proposition1+ check "Proposition 2:\n !n i.\n any (\\p. divides p (n + 2)) (take Prime.all i) \\/\n nth Prime.all i <= n + 2\n " proposition2+ return ()
− testsrc/Main.hs
@@ -1,45 +0,0 @@-{- |-module: Main-description: Prime natural numbers - testing-license: MIT--maintainer: Joe Leslie-Hurd <joe@gilith.com>-stability: provisional-portability: portable--}-module Main- ( main )-where--import qualified OpenTheory.Natural.Divides as Divides-import qualified OpenTheory.Natural.Prime as Prime-import qualified OpenTheory.Primitive.Natural as Natural-import qualified OpenTheory.Stream as Stream-import OpenTheory.Primitive.Test--assertion0 :: Bool-assertion0 = not (Stream.nth Prime.primes 0 == 0)--proposition0 :: Natural.Natural -> Natural.Natural -> Bool-proposition0 i j =- (Stream.nth Prime.primes i <= Stream.nth Prime.primes j) == (i <= j)--proposition1 :: Natural.Natural -> Natural.Natural -> Bool-proposition1 i j =- not- (Divides.divides (Stream.nth Prime.primes i)- (Stream.nth Prime.primes (i + (j + 1))))--proposition2 :: Natural.Natural -> Natural.Natural -> Bool-proposition2 n i =- any (\p -> Divides.divides p (n + 2))- (Stream.naturalTake Prime.primes i) ||- Stream.nth Prime.primes i <= n + 2--main :: IO ()-main =- do assert "Assertion 0:\n ~(nth Prime.all 0 = 0)\n " assertion0- check "Proposition 0:\n !i j. nth Prime.all i <= nth Prime.all j <=> i <= j\n " proposition0- check "Proposition 1:\n !i j. ~divides (nth Prime.all i) (nth Prime.all (i + (j + 1)))\n " proposition1- check "Proposition 2:\n !n i.\n any (\\p. divides p (n + 2)) (take Prime.all i) \\/\n nth Prime.all i <= n + 2\n " proposition2- return ()