Hello community,

here is the log from the commit of package ghc-scientific for openSUSE:Factory 
checked in at 2017-07-27 11:12:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-scientific (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-scientific.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-scientific"

Thu Jul 27 11:12:09 2017 rev:17 rq:511518 version:0.3.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-scientific/ghc-scientific.changes    
2017-07-12 19:35:29.820662404 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-scientific.new/ghc-scientific.changes       
2017-07-27 11:12:10.989988799 +0200
@@ -1,0 +2,5 @@
+Tue Jul 11 03:02:20 UTC 2017 - [email protected]
+
+- Update to version 0.3.5.1.
+
+-------------------------------------------------------------------

Old:
----
  scientific-0.3.4.15.tar.gz
  scientific.cabal

New:
----
  scientific-0.3.5.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-scientific.spec ++++++
--- /var/tmp/diff_new_pack.BASXgW/_old  2017-07-27 11:12:12.077835133 +0200
+++ /var/tmp/diff_new_pack.BASXgW/_new  2017-07-27 11:12:12.077835133 +0200
@@ -19,14 +19,13 @@
 %global pkg_name scientific
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.3.4.15
+Version:        0.3.5.1
 Release:        0
 Summary:        Numbers represented using scientific notation
 License:        BSD-3-Clause
 Group:          Development/Languages/Other
 Url:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
@@ -34,9 +33,9 @@
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-integer-logarithms-devel
+BuildRequires:  ghc-primitive-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-vector-devel
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -91,7 +90,6 @@
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ scientific-0.3.4.15.tar.gz -> scientific-0.3.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.15/changelog 
new/scientific-0.3.5.1/changelog
--- old/scientific-0.3.4.15/changelog   2017-06-04 22:37:46.000000000 +0200
+++ new/scientific-0.3.5.1/changelog    2017-07-08 00:06:03.000000000 +0200
@@ -1,3 +1,10 @@
+0.3.5.1
+       * Replace use of Vector from vector with Array from primitive.
+
+0.3.5.0
+       * Export scientificP :: ReadP Scientific
+         (Courtesy of Shlok Datye @shlok)
+
 0.3.4.15
        * Fix build for base < 4.8.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.15/scientific.cabal 
new/scientific-0.3.5.1/scientific.cabal
--- old/scientific-0.3.4.15/scientific.cabal    2017-06-04 22:37:46.000000000 
+0200
+++ new/scientific-0.3.5.1/scientific.cabal     2017-07-08 00:06:03.000000000 
+0200
@@ -1,5 +1,5 @@
 name:                scientific
-version:             0.3.4.15
+version:             0.3.5.1
 synopsis:            Numbers represented using scientific notation
 description:
   @Data.Scientific@ provides the number type 'Scientific'. Scientific numbers 
are
@@ -72,7 +72,7 @@
                      , deepseq     >= 1.3   && < 1.5
                      , text        >= 0.8   && < 1.3
                      , hashable    >= 1.1.2 && < 1.3
-                     , vector      >= 0.7   && < 0.13
+                     , primitive   >= 0.1   && < 0.7
                      , containers  >= 0.1   && < 0.6
                      , binary      >= 0.4.1 && < 0.9
 
@@ -104,9 +104,9 @@
                , tasty-ant-xml    >= 1.0   && < 1.2
                , tasty-hunit      >= 0.8   && < 0.10
                , tasty-smallcheck >= 0.2   && < 0.9
-               , tasty-quickcheck >= 0.8   && < 0.9
+               , tasty-quickcheck >= 0.8   && < 0.10
                , smallcheck       >= 1.0   && < 1.2
-               , QuickCheck       >= 2.5   && < 2.10
+               , QuickCheck       >= 2.5   && < 2.11
                , text             >= 0.8   && < 1.3
 
   if flag(bytestring-builder)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.15/src/Data/Scientific.hs 
new/scientific-0.3.5.1/src/Data/Scientific.hs
--- old/scientific-0.3.4.15/src/Data/Scientific.hs      2017-06-04 
22:37:46.000000000 +0200
+++ new/scientific-0.3.5.1/src/Data/Scientific.hs       2017-07-08 
00:06:03.000000000 +0200
@@ -74,6 +74,9 @@
     , toBoundedInteger
     , fromFloatDigits
 
+      -- * Parsing
+    , scientificP
+
       -- * Pretty printing
     , formatScientific
     , FPFormat(..)
@@ -102,9 +105,8 @@
 import qualified Data.Map            as M     (Map, empty, insert, lookup)
 import           Data.Ratio                   ((%), numerator, denominator)
 import           Data.Typeable                (Typeable)
-import qualified Data.Vector         as V
-import qualified Data.Vector.Mutable as VM
-import           Data.Word                    (Word, Word8, Word16, Word32, 
Word64)
+import qualified Data.Primitive.Array as Primitive
+import           Data.Word                    (Word8, Word16, Word32, Word64)
 import           Math.NumberTheory.Logarithms (integerLog10')
 import qualified Numeric                      (floatToDigits)
 import qualified Text.Read                       as Read
@@ -116,6 +118,7 @@
 
 #if !MIN_VERSION_base(4,8,0)
 import           Data.Functor                 ((<$>))
+import           Data.Word                    (Word)
 import           Control.Applicative          ((<*>))
 #endif
 
@@ -575,20 +578,20 @@
 maxExpt :: Int
 maxExpt = 324
 
-expts10 :: V.Vector Integer
+expts10 :: Primitive.Array Integer
 expts10 = runST $ do
-    mv <- VM.unsafeNew maxExpt
-    VM.unsafeWrite mv 0  1
-    VM.unsafeWrite mv 1 10
+    ma <- Primitive.newArray maxExpt uninitialised
+    Primitive.writeArray ma 0  1
+    Primitive.writeArray ma 1 10
     let go !ix
-          | ix == maxExpt = V.unsafeFreeze mv
+          | ix == maxExpt = Primitive.unsafeFreezeArray ma
           | otherwise = do
-              VM.unsafeWrite mv  ix        xx
-              VM.unsafeWrite mv (ix+1) (10*xx)
+              Primitive.writeArray ma  ix        xx
+              Primitive.writeArray ma (ix+1) (10*xx)
               go (ix+2)
           where
             xx = x * x
-            x  = V.unsafeIndex expts10 half
+            x  = Primitive.indexArray expts10 half
 #if MIN_VERSION_base(4,5,0)
             !half = ix `unsafeShiftR` 1
 #else
@@ -596,12 +599,15 @@
 #endif
     go 2
 
+uninitialised :: error
+uninitialised = error "Data.Scientific: uninitialised element"
+
 -- | @magnitude e == 10 ^ e@
 magnitude :: Int -> Integer
 magnitude e | e < maxExpt = cachedPow10 e
             | otherwise   = cachedPow10 hi * 10 ^ (e - hi)
     where
-      cachedPow10 = V.unsafeIndex expts10
+      cachedPow10 = Primitive.indexArray expts10
 
       hi = maxExpt - 1
 
@@ -786,12 +792,34 @@
 -- Parsing
 ----------------------------------------------------------------------
 
+-- | Supports the skipping of parentheses and whitespaces. Example:
+--
+-- > > read " ( ((  -1.0e+3 ) ))" :: Scientific
+-- > -1000.0
+--
+-- (Note: This @Read@ instance makes internal use of
+-- 'scientificP' to parse the floating-point number.)
 instance Read Scientific where
     readPrec = Read.parens $ ReadPrec.lift (ReadP.skipSpaces >> scientificP)
 
 -- A strict pair
 data SP = SP !Integer {-# UNPACK #-}!Int
 
+-- | A parser for parsing a floating-point
+-- number into a 'Scientific' value. Example:
+--
+-- > > import Text.ParserCombinators.ReadP (readP_to_S)
+-- > > readP_to_S scientificP "3"
+-- > [(3.0,"")]
+-- > > readP_to_S scientificP "3.0e2"
+-- > [(3.0,"e2"),(300.0,"")]
+-- > > readP_to_S scientificP "+3.0e+2"
+-- > [(3.0,"e+2"),(300.0,"")]
+-- > > readP_to_S scientificP "-3.0e-2"
+-- > [(-3.0,"e-2"),(-3.0e-2,"")]
+--
+-- Note: This parser only parses the number itself; it does
+-- not parse any surrounding parentheses or whitespaces.
 scientificP :: ReadP Scientific
 scientificP = do
   let positive = (('+' ==) <$> ReadP.satisfy isSign) `mplus` return True


Reply via email to