Accepting request 607878 from devel:languages:haskell
Update ghc-scientific to the latest version. OBS-URL: https://build.opensuse.org/request/show/607878 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ghc-scientific?expand=0&rev=18
This commit is contained in:
commit
6f52da54e2
@ -1,3 +1,54 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 14 17:02:11 UTC 2018 - psimons@suse.com
|
||||
|
||||
- Update scientific to version 0.3.6.2.
|
||||
* Due to a regression introduced in 0.3.4.14 the RealFrac methods
|
||||
and floatingOrInteger became vulnerable to a space blowup when
|
||||
applied to scientifics with huge exponents. This has now been
|
||||
fixed again.
|
||||
|
||||
* Fix build on GHC < 8.
|
||||
|
||||
* Make the methods of the Hashable, Eq and Ord instances safe to
|
||||
use when applied to scientific numbers coming from untrusted
|
||||
sources. Previously these methods first converted their arguments
|
||||
to Rational before applying the operation. This is unsafe because
|
||||
converting a Scientific to a Rational could fill up all space and
|
||||
crash your program when the Scientific has a huge base10Exponent.
|
||||
|
||||
Do note that the hash computation of the Hashable Scientific
|
||||
instance has been changed because of this improvement!
|
||||
|
||||
Thanks to Tom Sydney Kerckhove (@NorfairKing) for pushing me to
|
||||
fix this.
|
||||
|
||||
* fromRational :: Rational -> Scientific now throws an error
|
||||
instead of diverging when applied to a repeating decimal. This
|
||||
does mean it will consume space linear in the number of digits of
|
||||
the resulting scientific. This makes "fromRational" and the other
|
||||
Fractional methods "recip" and "/" a bit safer to use.
|
||||
|
||||
* To get the old unsafe but more efficient behaviour the following
|
||||
function was added: unsafeFromRational :: Rational -> Scientific.
|
||||
|
||||
* Add alternatives for fromRationalRepetend:
|
||||
|
||||
fromRationalRepetendLimited
|
||||
:: Int -- ^ limit
|
||||
-> Rational
|
||||
-> Either (Scientific, Rational)
|
||||
(Scientific, Maybe Int)
|
||||
|
||||
and:
|
||||
|
||||
fromRationalRepetendUnlimited
|
||||
:: Rational -> (Scientific, Maybe Int)
|
||||
|
||||
Thanks to Ian Jeffries (@seagreen) for the idea.
|
||||
|
||||
* Dropped upper version bounds of dependencies
|
||||
because it's to much work to maintain.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 11 03:02:20 UTC 2017 - psimons@suse.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package ghc-scientific
|
||||
#
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -19,12 +19,12 @@
|
||||
%global pkg_name scientific
|
||||
%bcond_with tests
|
||||
Name: ghc-%{pkg_name}
|
||||
Version: 0.3.5.1
|
||||
Version: 0.3.6.2
|
||||
Release: 0
|
||||
Summary: Numbers represented using scientific notation
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Other
|
||||
Url: https://hackage.haskell.org/package/%{pkg_name}
|
||||
Group: Development/Libraries/Haskell
|
||||
URL: https://hackage.haskell.org/package/%{pkg_name}
|
||||
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
|
||||
BuildRequires: ghc-Cabal-devel
|
||||
BuildRequires: ghc-binary-devel
|
||||
@ -36,7 +36,6 @@ BuildRequires: ghc-integer-logarithms-devel
|
||||
BuildRequires: ghc-primitive-devel
|
||||
BuildRequires: ghc-rpm-macros
|
||||
BuildRequires: ghc-text-devel
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if %{with tests}
|
||||
BuildRequires: ghc-QuickCheck-devel
|
||||
BuildRequires: ghc-smallcheck-devel
|
||||
@ -48,7 +47,7 @@ BuildRequires: ghc-tasty-smallcheck-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
'Data.Scientific' provides the number type 'Scientific'. Scientific numbers are
|
||||
"Data.Scientific" provides the number type 'Scientific'. Scientific numbers are
|
||||
arbitrary precision and space efficient. They are represented using
|
||||
<http://en.wikipedia.org/wiki/Scientific_notation scientific notation>.
|
||||
The implementation uses a coefficient 'c :: 'Integer'' and a base-10 exponent
|
||||
@ -71,7 +70,7 @@ constructed using '%' which has to compute the 'gcd' of the 'numerator' and
|
||||
'1e1000000000 :: 'Rational'' will fill up all space and crash your program.
|
||||
Scientific works as expected:
|
||||
|
||||
> > read "1e1000000000" :: Scientific > 1.0e1000000000
|
||||
>>> read "1e1000000000" :: Scientific 1.0e1000000000
|
||||
|
||||
* Also, the space usage of converting scientific numbers with huge exponents to
|
||||
''Integral's' (like: 'Int') or ''RealFloat's' (like: 'Double' or 'Float') will
|
||||
@ -79,7 +78,7 @@ always be bounded by the target type.
|
||||
|
||||
%package devel
|
||||
Summary: Haskell %{pkg_name} library development files
|
||||
Group: Development/Libraries/Other
|
||||
Group: Development/Libraries/Haskell
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ghc-compiler = %{ghc_version}
|
||||
Requires(post): ghc-compiler = %{ghc_version}
|
||||
@ -107,11 +106,9 @@ This package provides the Haskell %{pkg_name} library development files.
|
||||
%ghc_pkg_recache
|
||||
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE
|
||||
%license LICENSE
|
||||
|
||||
%files devel -f %{name}-devel.files
|
||||
%defattr(-,root,root,-)
|
||||
%doc changelog
|
||||
|
||||
%changelog
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5ba6e682cbb6cd5c6444d1c6c35f3b396e316637a14456b18de58c9a33661ba6
|
||||
size 20777
|
3
scientific-0.3.6.2.tar.gz
Normal file
3
scientific-0.3.6.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:278d0afc87450254f8a76eab21b5583af63954efc9b74844a17a21a68013140f
|
||||
size 23510
|
Loading…
Reference in New Issue
Block a user