Hello community,

here is the log from the commit of package ghc-yaml for openSUSE:Factory 
checked in at 2019-08-29 17:23:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yaml (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-yaml.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-yaml"

Thu Aug 29 17:23:34 2019 rev:31 rq:726819 version:0.11.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yaml/ghc-yaml.changes        2019-06-30 
10:21:54.111657531 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yaml.new.7948/ghc-yaml.changes      
2019-08-29 17:23:38.367306279 +0200
@@ -1,0 +2,16 @@
+Tue Aug 27 02:01:57 UTC 2019 - [email protected]
+
+- Update yaml to version 0.11.1.2.
+  ## 0.11.1.2
+
+  * Compiles with GHC 8.8.1 (`MonadFail` split)
+
+-------------------------------------------------------------------
+Sat Aug 24 02:01:14 UTC 2019 - [email protected]
+
+- Update yaml to version 0.11.1.1.
+  ## 0.11.1.1
+
+  * Use the appropriate `Scientific` rendering function to avoid a memory 
overflow when rendering. The previously used function from `aeson` would not 
use scientific notation, and could use large amounts of memory for values such 
as `1e9999999999999`.
+
+-------------------------------------------------------------------

Old:
----
  yaml-0.11.1.0.tar.gz

New:
----
  yaml-0.11.1.2.tar.gz

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

Other differences:
------------------
++++++ ghc-yaml.spec ++++++
--- /var/tmp/diff_new_pack.0gTmMh/_old  2019-08-29 17:23:39.003306173 +0200
+++ /var/tmp/diff_new_pack.0gTmMh/_new  2019-08-29 17:23:39.003306173 +0200
@@ -19,7 +19,7 @@
 %global pkg_name yaml
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.11.1.0
+Version:        0.11.1.2
 Release:        0
 Summary:        Support for parsing and rendering YAML documents
 License:        BSD-3-Clause

++++++ yaml-0.11.1.0.tar.gz -> yaml-0.11.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.1.0/ChangeLog.md 
new/yaml-0.11.1.2/ChangeLog.md
--- old/yaml-0.11.1.0/ChangeLog.md      2019-06-28 03:50:21.000000000 +0200
+++ new/yaml-0.11.1.2/ChangeLog.md      2019-08-26 20:14:53.000000000 +0200
@@ -1,5 +1,13 @@
 # ChangeLog for yaml
 
+## 0.11.1.2
+
+* Compiles with GHC 8.8.1 (`MonadFail` split)
+
+## 0.11.1.1
+
+* Use the appropriate `Scientific` rendering function to avoid a memory 
overflow when rendering. The previously used function from `aeson` would not 
use scientific notation, and could use large amounts of memory for values such 
as `1e9999999999999`.
+
 ## 0.11.1.0
 
 * Better error messages in the `Data.Yaml.Config` module 
[#168](https://github.com/snoyberg/yaml/issues/168)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.1.0/src/Data/Yaml/Parser.hs 
new/yaml-0.11.1.2/src/Data/Yaml/Parser.hs
--- old/yaml-0.11.1.0/src/Data/Yaml/Parser.hs   2018-10-12 08:00:28.000000000 
+0200
+++ new/yaml-0.11.1.2/src/Data/Yaml/Parser.hs   2019-08-26 20:15:41.000000000 
+0200
@@ -52,6 +52,9 @@
         case f am of
             Left t -> Left t
             Right x -> unYamlParser (g x) am
+#if MIN_VERSION_base(4,13,0)
+instance MonadFail YamlParser where
+#endif
     fail = YamlParser . const . Left . pack
 instance MonadPlus YamlParser where
     mzero = fail "mzero"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.1.0/src/Data/Yaml.hs 
new/yaml-0.11.1.2/src/Data/Yaml.hs
--- old/yaml-0.11.1.0/src/Data/Yaml.hs  2018-10-12 08:00:28.000000000 +0200
+++ new/yaml-0.11.1.2/src/Data/Yaml.hs  2019-08-26 19:52:52.000000000 +0200
@@ -94,22 +94,18 @@
     , Object, Array
     , withObject, withText, withArray, withScientific, withBool
     )
-#if MIN_VERSION_aeson(1,0,0)
-import Data.Aeson.Text (encodeToTextBuilder)
-#else
-import Data.Aeson.Encode (encodeToTextBuilder)
-#endif
+import qualified Data.Scientific as S
+import qualified Data.ByteString.Builder.Scientific
 import Data.Aeson.Types (Pair, parseMaybe, parseEither, Parser)
 import Data.ByteString (ByteString)
+import qualified Data.ByteString.Builder as BB
+import qualified Data.ByteString.Lazy as BL
 import Data.Conduit ((.|), runConduitRes)
 import qualified Data.Conduit.List as CL
 import qualified Data.HashMap.Strict as M
 import qualified Data.HashSet as HashSet
 import Data.Text.Encoding (encodeUtf8)
 import qualified Data.Text as T
-import qualified Data.Text.Encoding as TE
-import qualified Data.Text.Lazy as TL
-import Data.Text.Lazy.Builder (toLazyText)
 import qualified Data.Vector as V
 import System.IO.Unsafe (unsafePerformIO)
 import Data.Text (Text)
@@ -220,8 +216,15 @@
     objToEvents' Null rest = EventScalar "null" NullTag PlainNoTag Nothing : 
rest
     objToEvents' (Bool True) rest = EventScalar "true" BoolTag PlainNoTag 
Nothing : rest
     objToEvents' (Bool False) rest = EventScalar "false" BoolTag PlainNoTag 
Nothing : rest
-    -- Use aeson's implementation which gets rid of annoying decimal points
-    objToEvents' n@Number{} rest = EventScalar (TE.encodeUtf8 $ TL.toStrict $ 
toLazyText $ encodeToTextBuilder n) IntTag PlainNoTag Nothing : rest
+
+    objToEvents' (Number s) rest =
+      let builder
+            -- Special case the 0 exponent to remove the trailing .0
+            | S.base10Exponent s == 0 = BB.integerDec $ S.coefficient s
+            | otherwise = Data.ByteString.Builder.Scientific.scientificBuilder 
s
+          lbs = BB.toLazyByteString builder
+          bs = BL.toStrict lbs
+       in EventScalar bs IntTag PlainNoTag Nothing : rest
 
     pairToEvents :: Pair -> [Y.Event] -> [Y.Event]
     pairToEvents (k, v) = objToEvents' (String k) . objToEvents' v
@@ -296,5 +299,10 @@
 array :: [Value] -> Value
 array = Array . V.fromList
 
+#if MIN_VERSION_base(4, 13, 0)
+parseMonad :: MonadFail m => (a -> Parser b) -> a -> m b
+#else
 parseMonad :: Monad m => (a -> Parser b) -> a -> m b
+#endif
 parseMonad p = either fail return . parseEither p
+{-# DEPRECATED parseMonad "With the MonadFail split, this function is going to 
be removed in the future. Please migrate to parseEither." #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.1.0/test/Data/YamlSpec.hs 
new/yaml-0.11.1.2/test/Data/YamlSpec.hs
--- old/yaml-0.11.1.0/test/Data/YamlSpec.hs     2019-02-12 09:48:15.000000000 
+0100
+++ new/yaml-0.11.1.2/test/Data/YamlSpec.hs     2019-08-23 06:18:43.000000000 
+0200
@@ -11,6 +11,7 @@
 import qualified Data.ByteString as BS
 import qualified Data.ByteString.Char8 as B8
 import Data.Int (Int64)
+import qualified Data.Scientific as S
 
 import Test.HUnit hiding (Test, path)
 
@@ -20,6 +21,7 @@
 import Control.Monad
 import Control.Exception (try, SomeException)
 import Test.Hspec
+import Test.Hspec.QuickCheck
 import Data.Either.Compat
 import System.Directory (createDirectory, createDirectoryIfMissing)
 import Test.Mockery.Directory
@@ -310,6 +312,13 @@
           ] `shouldReturn`
         "[\"foo\", 99, 99.99, bar, !foo \"foo\", !foo foo]\n"
 
+      prop "Scientific values round-trip" $ \coeff expon -> do
+        let val = D.Number $ S.scientific coeff expon
+        let rendered = D.encode val
+        case D.decodeEither' rendered of
+          Left e -> error $ show (coeff, expon, e)
+          Right val' -> val' `shouldBe` val
+
 specialStrings :: [T.Text]
 specialStrings =
     [ "fo\"o"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yaml-0.11.1.0/yaml.cabal new/yaml-0.11.1.2/yaml.cabal
--- old/yaml-0.11.1.0/yaml.cabal        2019-06-26 15:23:29.000000000 +0200
+++ new/yaml-0.11.1.2/yaml.cabal        2019-08-26 20:14:42.000000000 +0200
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 3a4f2b1c1a7a978d5810ea6223b95b1c51f38f60610704c35e28f8bc667081ba
+-- hash: fd80752d31072e9d0302c6aab5e524dff535a5e9d72ff7b14a2c1bd0e8cdc86a
 
 name:           yaml
-version:        0.11.1.0
+version:        0.11.1.2
 synopsis:       Support for parsing and rendering YAML documents.
 description:    README and API documentation are available at 
<https://www.stackage.org/package/yaml>
 category:       Data
@@ -76,7 +76,7 @@
     , libyaml >=0.1 && <0.2
     , mtl
     , resourcet >=0.3 && <1.3
-    , scientific
+    , scientific >=0.3
     , template-haskell
     , text
     , transformers >=0.1
@@ -108,7 +108,7 @@
     , libyaml >=0.1 && <0.2
     , mtl
     , resourcet >=0.3 && <1.3
-    , scientific
+    , scientific >=0.3
     , template-haskell
     , text
     , transformers >=0.1
@@ -143,7 +143,7 @@
     , libyaml >=0.1 && <0.2
     , mtl
     , resourcet >=0.3 && <1.3
-    , scientific
+    , scientific >=0.3
     , template-haskell
     , text
     , transformers >=0.1
@@ -175,7 +175,7 @@
     , libyaml >=0.1 && <0.2
     , mtl
     , resourcet >=0.3 && <1.3
-    , scientific
+    , scientific >=0.3
     , template-haskell
     , text
     , transformers >=0.1
@@ -218,7 +218,7 @@
     , mtl
     , raw-strings-qq
     , resourcet >=0.3 && <1.3
-    , scientific
+    , scientific >=0.3
     , template-haskell
     , temporary
     , text


Reply via email to