fast-arithmetic 0.3.3.4 → 0.3.3.5
raw patch · 7 files changed
+25/−25 lines, 7 filesdep +combinat-compatdep −combinatdep ~base
Dependencies added: combinat-compat
Dependencies removed: combinat
Dependency ranges changed: base
Files
- ats-src/combinatorics-internal.dats +3/−3
- ats-src/number-theory-internal.dats +3/−3
- ats-src/numerics-internal.dats +3/−3
- ats-src/numerics.dats +5/−6
- atspkg.dhall +2/−2
- fast-arithmetic.cabal +5/−5
- src/Numeric/Pure.hs +4/−3
ats-src/combinatorics-internal.dats view
@@ -1,8 +1,8 @@ #include "share/atspre_staload.hats"-#include "contrib/atscntrb-hx-intinf/mydepies.hats"-#include "contrib/atscntrb-hx-intinf/mylibies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mydepies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mylibies.hats" -staload "contrib/atscntrb-hx-intinf/SATS/intinf_vt.sats"+staload "$PATSHOMELOCS/atscntrb-hx-intinf/SATS/intinf_vt.sats" staload UN = "prelude/SATS/unsafe.sats" // See [here](http://mathworld.wolfram.com/Derangement.html)
ats-src/number-theory-internal.dats view
@@ -1,11 +1,11 @@ #include "share/atspre_staload.hats"-#include "contrib/atscntrb-hx-intinf/mydepies.hats"-#include "contrib/atscntrb-hx-intinf/mylibies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mydepies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mylibies.hats" #include "ats-src/numerics-internal.dats" staload "prelude/SATS/integer.sats" staload UN = "prelude/SATS/unsafe.sats"-staload "contrib/atscntrb-hx-intinf/SATS/intinf_vt.sats"+staload "$PATSHOMELOCS/atscntrb-hx-intinf/SATS/intinf_vt.sats" #define ATS_MAINATSFLAG 1
ats-src/numerics-internal.dats view
@@ -1,8 +1,8 @@ #include "share/atspre_staload.hats"-#include "contrib/atscntrb-hx-intinf/mylibies.hats"-#include "contrib/atscntrb-libgmp/mylibies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mydepies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-intinf/mylibies.hats" -staload "contrib/atscntrb-hx-intinf/SATS/intinf_vt.sats"+staload "$PATSHOMELOCS/atscntrb-hx-intinf/SATS/intinf_vt.sats" staload "libats/libc/SATS/math.sats" staload UN = "prelude/SATS/unsafe.sats"
ats-src/numerics.dats view
@@ -2,10 +2,10 @@ #include "share/atspre_staload.hats" #include "ats-src/numerics-internal.dats"-#include "$PATSHOMELOCS/atscntrb-libgmp/mylibies.hats"+#include "$PATSHOMELOCS/atscntrb-hx-libgmp/mylibies.hats" -staload "contrib/atscntrb-hx-intinf/SATS/intinf_vt.sats"-staload "contrib/atscntrb-libgmp/SATS/gmp.sats"+staload "$PATSHOMELOCS/atscntrb-hx-intinf/SATS/intinf_vt.sats"+staload "$PATSHOMELOCS/atscntrb-hx-libgmp/SATS/gmp.sats" extern fun mpz_free : (&mpz >> mpz?) -> void =@@ -29,8 +29,7 @@ implement exp_ats (m, n) = exp(m, n) -implement fib_ats (m) =- fib_gmp(m)-+// implement fib_ats (m) =+// fib_gmp(m) implement mpz_free (x) = mpz_clear(x)
atspkg.dhall view
@@ -1,13 +1,13 @@ let prelude = https://raw.githubusercontent.com/vmchale/atspkg/master/ats-pkg/dhall/atspkg-prelude.dhall in -prelude.default ⫽ +prelude.default ⫽ { libraries = [ prelude.lib ⫽ { name = "storable" , src = [ "ats-src/combinatorics.dats", "ats-src/number-theory.dats", "ats-src/numerics.dats" ]- , libTarget = "${prelude.cabalDir}/libnumbertheory.a"+ , libTarget = "dist-newstyle/lib/libnumbertheory.a" , static = True } ]
fast-arithmetic.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: fast-arithmetic-version: 0.3.3.4+version: 0.3.3.5 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -64,12 +64,12 @@ default-language: Haskell2010 ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall build-depends:- base ==4.10.*,+ base -any, fast-arithmetic -any, hspec -any, QuickCheck -any, arithmoi -any,- combinat -any+ combinat-compat -any if flag(development) ghc-options: -Werror@@ -85,11 +85,11 @@ default-language: Haskell2010 ghc-options: -Wall build-depends:- base ==4.10.*,+ base -any, fast-arithmetic -any, criterion -any, arithmoi -any,- combinat -any+ combinat-compat -any if flag(development) ghc-options: -Werror
src/Numeric/Pure.hs view
@@ -18,12 +18,13 @@ derangements :: (Integral a) => [a] derangements = fmap snd g- where g = (0, 1) : (1, 0) : zipWith (\(_, n) (i, m) -> (i + 1, i * (n + m))) g (tail g)+ where g = (0, 1) : (1, 0) : zipWith step g (tail g)+ step (_, n) (i, m) = (i + 1, i * (n + m)) hsIsPrime :: (Integral a) => a -> Bool hsIsPrime 1 = False-hsIsPrime x = all ((/=0) . (x `mod`)) [2..m]- where m = floor (sqrt (fromIntegral x :: Float))+hsIsPrime x = all ((/=0) . (x `mod`)) [2..up]+ where up = floor (sqrt (fromIntegral x :: Float)) fibs :: (Integral a) => [a] fibs = 1 : 1 : zipWith (+) fibs (tail fibs)