Hello community,

here is the log from the commit of package ghc-blaze-builder for 
openSUSE:Factory checked in at 2018-05-30 12:02:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-blaze-builder (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-blaze-builder"

Wed May 30 12:02:13 2018 rev:8 rq:607756 version:0.4.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-blaze-builder/ghc-blaze-builder.changes      
2017-09-15 21:23:36.431834788 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new/ghc-blaze-builder.changes 
2018-05-30 12:23:54.672996930 +0200
@@ -1,0 +2,8 @@
+Mon May 14 17:02:11 UTC 2018 - [email protected]
+
+- Update blaze-builder to version 0.4.1.0.
+  - Gain compatibility with the Semigroup/Monoid proposal
+  - Add Word8 HTML escaping builders
+  - Speed up `fromHtmlEscapedText` and `fromHtmlEscapedLazyText`
+
+-------------------------------------------------------------------

Old:
----
  blaze-builder-0.4.0.2.tar.gz

New:
----
  blaze-builder-0.4.1.0.tar.gz

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

Other differences:
------------------
++++++ ghc-blaze-builder.spec ++++++
--- /var/tmp/diff_new_pack.W8T2tW/_old  2018-05-30 12:23:55.260978689 +0200
+++ /var/tmp/diff_new_pack.W8T2tW/_new  2018-05-30 12:23:55.264978565 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-blaze-builder
 #
-# 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,7 +19,7 @@
 %global pkg_name blaze-builder
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.4.0.2
+Version:        0.4.1.0
 Release:        0
 Summary:        Efficient buffered output
 License:        BSD-3-Clause
@@ -83,7 +83,7 @@
 %ghc_pkg_recache
 
 %files -f %{name}.files
-%doc LICENSE
+%license LICENSE
 
 %files devel -f %{name}-devel.files
 %doc CHANGES README.markdown TODO

++++++ blaze-builder-0.4.0.2.tar.gz -> blaze-builder-0.4.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Html/Utf8.hs 
new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Html/Utf8.hs
--- old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Html/Utf8.hs     
2016-04-18 21:47:02.000000000 +0200
+++ new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Html/Utf8.hs     
2018-03-14 22:11:24.000000000 +0100
@@ -39,7 +39,9 @@
 import Data.ByteString.Char8 ()  -- for the 'IsString' instance of bytesrings
 
 import qualified Data.Text      as TS
+import qualified Data.Text.Encoding as TE
 import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TLE
 
 import Blaze.ByteString.Builder.Compat.Write ( Write, writePrimBounded )
 import qualified Data.ByteString.Builder       as B
@@ -47,6 +49,7 @@
 import qualified Data.ByteString.Builder.Prim  as P
 
 import Blaze.ByteString.Builder.Char.Utf8
+import Blaze.ByteString.Builder.Html.Word
 
 -- | Write a HTML escaped and UTF-8 encoded Unicode character to a bufffer.
 --
@@ -101,9 +104,17 @@
 -- UTF-8 encoding.
 --
 fromHtmlEscapedText :: TS.Text -> B.Builder
+#if MIN_VERSION_text(1,1,2) && MIN_VERSION_bytestring(0,10,4)
+fromHtmlEscapedText = TE.encodeUtf8BuilderEscaped wordHtmlEscaped
+#else
 fromHtmlEscapedText = fromHtmlEscapedString . TS.unpack
+#endif
 
 -- | /O(n)/. Serialize a HTML escaped Unicode 'TL.Text' using the UTF-8 
encoding.
 --
 fromHtmlEscapedLazyText :: TL.Text -> B.Builder
+#if MIN_VERSION_text(1,1,2) && MIN_VERSION_bytestring(0,10,4)
+fromHtmlEscapedLazyText = TLE.encodeUtf8BuilderEscaped wordHtmlEscaped
+#else
 fromHtmlEscapedLazyText = fromHtmlEscapedString . TL.unpack
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Html/Word.hs 
new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Html/Word.hs
--- old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Html/Word.hs     
1970-01-01 01:00:00.000000000 +0100
+++ new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Html/Word.hs     
2018-03-14 22:11:24.000000000 +0100
@@ -0,0 +1,79 @@
+{-# LANGUAGE CPP #-}
+#if __GLASGOW_HASKELL__ >= 704
+{-# OPTIONS_GHC -fsimpl-tick-factor=40000 #-}
+#endif
+
+------------------------------------------------------------------------------
+-- |
+-- Module:      Blaze.ByteString.Builder.Html.Word
+-- Copyright:   (c) 2016 Dylan Simon
+-- License:     BSD3
+-- Maintainer:  Leon P Smith <[email protected]>
+-- Stability:   experimental
+--
+-- 'W.Write's and 'B.Builder's for serializing HTML escaped 'Word8' characters
+-- and 'BS.ByteString's that have already been appropriately encoded into HTML 
by
+-- escaping basic ASCII character references but leaving other bytes untouched.
+--
+------------------------------------------------------------------------------
+
+module Blaze.ByteString.Builder.Html.Word
+  ( wordHtmlEscaped
+    -- * Writing HTML escaped bytes to a buffer
+  , writeHtmlEscapedWord
+    -- * Creating Builders from HTML escaped bytes
+  , fromHtmlEscapedWord
+  , fromHtmlEscapedWordList
+  , fromHtmlEscapedByteString
+  , fromHtmlEscapedLazyByteString
+  ) where
+
+import qualified Blaze.ByteString.Builder.Compat.Write as W
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Builder as B
+import qualified Data.ByteString.Builder.Prim as P
+import           Data.ByteString.Internal (c2w)
+import qualified Data.ByteString.Lazy as BSL
+import           Data.Word (Word8)
+
+{-# INLINE wordHtmlEscaped #-}
+wordHtmlEscaped :: P.BoundedPrim Word8
+wordHtmlEscaped =
+  P.condB (>  c2w '>' ) (P.condB (== c2w '\DEL') P.emptyB $ 
P.liftFixedToBounded P.word8) $
+  P.condB (== c2w '<' ) (fixed4 ('&',('l',('t',';')))) $        -- &lt;
+  P.condB (== c2w '>' ) (fixed4 ('&',('g',('t',';')))) $        -- &gt;
+  P.condB (== c2w '&' ) (fixed5 ('&',('a',('m',('p',';'))))) $  -- &amp;
+  P.condB (== c2w '"' ) (fixed6 ('&',('q',('u',('o',('t',';')))))) $  -- &quot;
+  P.condB (== c2w '\'') (fixed5 ('&',('#',('3',('9',';'))))) $  -- &#39;
+  P.condB (\c -> c >= c2w ' ' || c == c2w '\t' || c == c2w '\n' || c == c2w 
'\r')
+        (P.liftFixedToBounded P.word8) P.emptyB
+  where
+  {-# INLINE fixed4 #-}
+  fixed4 x = P.liftFixedToBounded $ const x P.>$<
+    P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< P.char8
+  {-# INLINE fixed5 #-}
+  fixed5 x = P.liftFixedToBounded $ const x P.>$<
+    P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< P.char8
+  {-# INLINE fixed6 #-}
+  fixed6 x = P.liftFixedToBounded $ const x P.>$<
+    P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< P.char8 P.>*< 
P.char8
+
+-- | Write a HTML escaped byte to a bufffer.
+writeHtmlEscapedWord :: Word8 -> W.Write
+writeHtmlEscapedWord = W.writePrimBounded wordHtmlEscaped
+
+-- | /O(1)./ Serialize a HTML escaped byte.
+fromHtmlEscapedWord :: Word8 -> B.Builder
+fromHtmlEscapedWord = P.primBounded wordHtmlEscaped
+
+-- | /O(n)/. Serialize a HTML escaped list of bytes.
+fromHtmlEscapedWordList :: [Word8] -> B.Builder
+fromHtmlEscapedWordList = P.primMapListBounded wordHtmlEscaped
+
+-- | /O(n)/. Serialize a HTML escaped 'BS.ByteString'.
+fromHtmlEscapedByteString :: BS.ByteString -> B.Builder
+fromHtmlEscapedByteString = P.primMapByteStringBounded wordHtmlEscaped
+
+-- | /O(n)/. Serialize a HTML escaped lazy 'BSL.ByteString'.
+fromHtmlEscapedLazyByteString :: BSL.ByteString -> B.Builder
+fromHtmlEscapedLazyByteString = P.primMapLazyByteStringBounded wordHtmlEscaped
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Internal/Write.hs 
new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Internal/Write.hs
--- old/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Internal/Write.hs        
2016-04-18 21:47:02.000000000 +0200
+++ new/blaze-builder-0.4.1.0/Blaze/ByteString/Builder/Internal/Write.hs        
2018-03-14 22:11:24.000000000 +0100
@@ -49,13 +49,13 @@
 
 import Foreign
 
+import qualified Data.Foldable as F
 import Control.Monad
 
 import Data.ByteString.Builder.Internal
 
-#if !MIN_VERSION_base(4,8,0)
-import Data.Monoid
-#endif
+import Data.Monoid (Monoid(..))
+import Data.Semigroup (Semigroup(..))
 
 ------------------------------------------------------------------------------
 -- Poking a buffer and writing to a buffer
@@ -119,27 +119,45 @@
     getBound $ write $ error $
     "getBound' called from " ++ msg ++ ": write bound is not data-independent."
 
+instance Semigroup Poke where
+  {-# INLINE (<>) #-}
+  (Poke po1) <> (Poke po2) = Poke $ po1 >=> po2
+
+  {-# INLINE sconcat #-}
+  sconcat = F.foldr (<>) mempty
+
 instance Monoid Poke where
   {-# INLINE mempty #-}
   mempty = Poke $ return
 
+#if !(MIN_VERSION_base(4,11,0))
   {-# INLINE mappend #-}
   (Poke po1) `mappend` (Poke po2) = Poke $ po1 >=> po2
 
   {-# INLINE mconcat #-}
-  mconcat = foldr mappend mempty
+  mconcat = F.foldr mappend mempty
+#endif
+
+instance Semigroup Write where
+  {-# INLINE (<>) #-}
+  (Write bound1 w1) <> (Write bound2 w2) =
+    Write (bound1 + bound2) (w1 <> w2)
+
+  {-# INLINE sconcat #-}
+  sconcat = F.foldr (<>) mempty
 
 instance Monoid Write where
   {-# INLINE mempty #-}
   mempty = Write 0 mempty
 
+#if !(MIN_VERSION_base(4,11,0))
   {-# INLINE mappend #-}
   (Write bound1 w1) `mappend` (Write bound2 w2) =
     Write (bound1 + bound2) (w1 `mappend` w2)
 
   {-# INLINE mconcat #-}
-  mconcat = foldr mappend mempty
-
+  mconcat = F.foldr mappend mempty
+#endif
 
 -- | @pokeN size io@ creates a write that denotes the writing of @size@ bytes
 -- to a buffer using the IO action @io@. Note that @io@ MUST write EXACTLY 
@size@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.4.0.2/CHANGES 
new/blaze-builder-0.4.1.0/CHANGES
--- old/blaze-builder-0.4.0.2/CHANGES   2016-04-18 21:47:02.000000000 +0200
+++ new/blaze-builder-0.4.1.0/CHANGES   2018-03-14 22:11:24.000000000 +0100
@@ -1,3 +1,8 @@
+* 0.4.1.0
+  - Gain compatibility with the Semigroup/Monoid proposal
+  - Add Word8 HTML escaping builders
+  - Speed up `fromHtmlEscapedText` and `fromHtmlEscapedLazyText`
+
 * 0.4.0.2
   - Fixed warnings on GHC 7.10,  courtesy of Mikhail Glushenkov.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.4.0.2/benchmarks/StringAndText.hs 
new/blaze-builder-0.4.1.0/benchmarks/StringAndText.hs
--- old/blaze-builder-0.4.0.2/benchmarks/StringAndText.hs       2016-04-18 
21:47:02.000000000 +0200
+++ new/blaze-builder-0.4.1.0/benchmarks/StringAndText.hs       2018-03-14 
22:11:24.000000000 +0100
@@ -25,7 +25,8 @@
 import qualified Data.Text.Lazy.Encoding as TL
 
 import qualified Blaze.ByteString.Builder           as Blaze
-import qualified Blaze.ByteString.Builder.Internal  as Blaze
+import qualified Data.ByteString.Builder.Internal   as Blaze
+import qualified Blaze.ByteString.Builder.Char.Utf8 as Blaze
 import qualified Blaze.ByteString.Builder.Html.Utf8 as Blaze
 
 main :: IO ()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.4.0.2/blaze-builder.cabal 
new/blaze-builder-0.4.1.0/blaze-builder.cabal
--- old/blaze-builder-0.4.0.2/blaze-builder.cabal       2016-04-18 
21:47:02.000000000 +0200
+++ new/blaze-builder-0.4.1.0/blaze-builder.cabal       2018-03-14 
22:11:24.000000000 +0100
@@ -1,5 +1,5 @@
 Name:                blaze-builder
-Version:             0.4.0.2
+Version:             0.4.1.0
 Synopsis:            Efficient buffered output.
 
 Description:
@@ -63,6 +63,7 @@
                      Blaze.ByteString.Builder.Char.Utf8
                      Blaze.ByteString.Builder.Char8
                      Blaze.ByteString.Builder.Html.Utf8
+                     Blaze.ByteString.Builder.Html.Word
                      Blaze.ByteString.Builder.HTTP
                      Blaze.ByteString.Builder.Compat.Write
 
@@ -78,6 +79,9 @@
   else
      build-depends:  bytestring >= 0.10.4 && < 1.0
 
+  if impl(ghc < 8.0)
+     build-depends: semigroups >= 0.16 && < 0.19
+
 test-suite test
   type:           exitcode-stdio-1.0
 


Reply via email to