packages feed

opentheory-divides 1.55 → 1.56

raw patch · 3 files changed

+63/−68 lines, 3 filesdep ~opentheorydep ~opentheory-primitivePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: opentheory, opentheory-primitive

API changes (from Hackage documentation)

Files

opentheory-divides.cabal view
@@ -1,5 +1,5 @@ name: opentheory-divides-version: 1.55+version: 1.56 category: Number Theory synopsis: The divides relation on natural numbers license: MIT@@ -10,31 +10,26 @@ maintainer: Joe Leslie-Hurd <joe@gilith.com> description:   The divides relation on natural numbers - this package was automatically-  generated from the OpenTheory package natural-divides-1.55+  generated from the OpenTheory package natural-divides-1.56  library   build-depends:     base >= 4.0 && < 5.0,     QuickCheck >= 2.4.0.1 && < 3.0,-    opentheory-primitive >= 1.3 && < 2.0,-    opentheory >= 1.195 && < 1.196-+    opentheory-primitive >= 1.4 && < 2.0,+    opentheory >= 1.195 && < 1.197   hs-source-dirs: src-   ghc-options: -Wall-   exposed-modules:     OpenTheory.Natural.Divides -executable opentheory-divides-test+test-suite opentheory-divides-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.195 && < 1.196--  hs-source-dirs: src, testsrc-+    opentheory-primitive >= 1.4 && < 2.0,+    opentheory >= 1.195 && < 1.197+  hs-source-dirs: src   ghc-options: -Wall--  main-is: Main.hs+  main-is: Test.hs
+ src/Test.hs view
@@ -0,0 +1,53 @@+{- |+module: Main+description: The divides relation on natural numbers - testing+license: MIT++maintainer: Joe Leslie-Hurd <joe@gilith.com>+stability: provisional+portability: portable+-}+module Main+  ( main )+where++import qualified OpenTheory.Natural as Natural+import qualified OpenTheory.Natural.Divides as Divides+import qualified OpenTheory.Primitive.Natural as Primitive.Natural+import OpenTheory.Primitive.Test++proposition0 :: Primitive.Natural.Natural -> Bool+proposition0 a = Divides.divides a 0++proposition1 :: Primitive.Natural.Natural -> Bool+proposition1 a = Divides.divides a a++proposition2 :: Primitive.Natural.Natural -> Bool+proposition2 a = Divides.divides 1 a++proposition3 ::+  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool+proposition3 a b = Divides.divides (fst (Divides.egcd a b)) a++proposition4 ::+  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool+proposition4 a b = Divides.divides (fst (Divides.egcd a b)) b++proposition5 :: Primitive.Natural.Natural -> Bool+proposition5 a = Divides.divides 2 a == Natural.naturalEven a++proposition6 ::+  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool+proposition6 a b =+  let (g, (s, t)) = Divides.egcd (a + 1) b in t * b + g == s * (a + 1)++main :: IO ()+main =+    do check "Proposition 0:\n  !a. divides a 0\n  " proposition0+       check "Proposition 1:\n  !a. divides a a\n  " proposition1+       check "Proposition 2:\n  !a. divides 1 a\n  " proposition2+       check "Proposition 3:\n  !a b. divides (fst (egcd a b)) a\n  " proposition3+       check "Proposition 4:\n  !a b. divides (fst (egcd a b)) b\n  " proposition4+       check "Proposition 5:\n  !a. divides 2 a <=> even a\n  " proposition5+       check "Proposition 6:\n  !a b. let (g, s, t) <- egcd (a + 1) b in t * b + g = s * (a + 1)\n  " proposition6+       return ()
− testsrc/Main.hs
@@ -1,53 +0,0 @@-{- |-module: Main-description: The divides relation on natural numbers - testing-license: MIT--maintainer: Joe Leslie-Hurd <joe@gilith.com>-stability: provisional-portability: portable--}-module Main-  ( main )-where--import qualified OpenTheory.Natural as Natural-import qualified OpenTheory.Natural.Divides as Divides-import qualified OpenTheory.Primitive.Natural as Primitive.Natural-import OpenTheory.Primitive.Test--proposition0 :: Primitive.Natural.Natural -> Bool-proposition0 a = Divides.divides a 0--proposition1 :: Primitive.Natural.Natural -> Bool-proposition1 a = Divides.divides a a--proposition2 :: Primitive.Natural.Natural -> Bool-proposition2 a = Divides.divides 1 a--proposition3 ::-  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool-proposition3 a b = Divides.divides (fst (Divides.egcd a b)) a--proposition4 ::-  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool-proposition4 a b = Divides.divides (fst (Divides.egcd a b)) b--proposition5 :: Primitive.Natural.Natural -> Bool-proposition5 a = Divides.divides 2 a == Natural.naturalEven a--proposition6 ::-  Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool-proposition6 a b =-  let (g, (s, t)) = Divides.egcd (a + 1) b in t * b + g == s * (a + 1)--main :: IO ()-main =-    do check "Proposition 0:\n  !a. divides a 0\n  " proposition0-       check "Proposition 1:\n  !a. divides a a\n  " proposition1-       check "Proposition 2:\n  !a. divides 1 a\n  " proposition2-       check "Proposition 3:\n  !a b. divides (fst (egcd a b)) a\n  " proposition3-       check "Proposition 4:\n  !a b. divides (fst (egcd a b)) b\n  " proposition4-       check "Proposition 5:\n  !a. divides 2 a <=> even a\n  " proposition5-       check "Proposition 6:\n  !a b. let (g, s, t) <- egcd (a + 1) b in t * b + g = s * (a + 1)\n  " proposition6-       return ()