Hello community,

here is the log from the commit of package ghc-blaze-builder for 
openSUSE:Factory checked in at 2014-11-26 20:55:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-blaze-builder (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-blaze-builder"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-blaze-builder/ghc-blaze-builder.changes      
2014-04-02 17:19:30.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new/ghc-blaze-builder.changes 
2014-11-26 20:55:28.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Sep 24 10:16:47 UTC 2014 - [email protected]
+
+- update to 0.3.3.4
+* compatibility with Haskell Platform 2014.2.0.0 (ghc-text) 
+
+-------------------------------------------------------------------

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

New:
----
  _service
  blaze-builder-0.3.3.4.tar.gz

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

Other differences:
------------------
++++++ ghc-blaze-builder.spec ++++++
--- /var/tmp/diff_new_pack.qV2XTh/_old  2014-11-26 20:55:29.000000000 +0100
+++ /var/tmp/diff_new_pack.qV2XTh/_new  2014-11-26 20:55:29.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-blaze-builder
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products 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
 
 Name:           ghc-blaze-builder
-Version:        0.3.1.1
+Version:        0.3.3.4
 Release:        0
 Summary:        Haskell library for efficient buffered output
 License:        BSD-3-Clause

++++++ _service ++++++
<services>
  <service name="download_files" mode="localonly"/>
</services>
++++++ blaze-builder-0.3.1.1.tar.gz -> blaze-builder-0.3.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Buffer.hs 
new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Buffer.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Buffer.hs       
2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Buffer.hs       
2014-09-17 07:58:54.000000000 +0200
@@ -18,7 +18,7 @@
 --
 module Blaze.ByteString.Builder.Internal.Buffer (
   -- * Buffers
-    Buffer
+    Buffer (..)
 
   -- ** Status information
   , freeSize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Types.hs 
new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Types.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Types.hs        
2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Types.hs        
2014-09-17 07:58:54.000000000 +0200
@@ -19,9 +19,7 @@
 --
 module Blaze.ByteString.Builder.Internal.Types where
 
-#ifdef APPLICATIVE_IN_BASE
 import Control.Applicative
-#endif
 
 import Data.Monoid
 import qualified Data.ByteString      as S
@@ -86,7 +84,6 @@
   fmap f (Put put) = Put $ \k -> put (\x -> k (f x))
   {-# INLINE fmap #-}
 
-#ifdef APPLICATIVE_IN_BASE
 instance Applicative Put where
   pure x = Put $ \k -> k x
   {-# INLINE pure #-}
@@ -96,7 +93,6 @@
   {-# INLINE (<*) #-}
   a *> b = Put $ \k -> unPut a (\_ -> unPut b k)
   {-# INLINE (*>) #-}
-#endif
 
 instance Monad Put where
   return x = Put $ \k -> k x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal.hs 
new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal.hs      
2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal.hs      
2014-09-17 07:58:54.000000000 +0200
@@ -39,6 +39,7 @@
 
   -- * Writes
   , module Blaze.ByteString.Builder.Internal.Write
+  , writeToByteString
 
   -- * Execution
   , toLazyByteString
@@ -62,6 +63,11 @@
 #endif
 
 import Control.Monad (unless)
+#if MIN_VERSION_base(4,4,0)
+import System.IO.Unsafe (unsafeDupablePerformIO)
+#else
+import System.IO.Unsafe (unsafePerformIO)
+#endif
 
 import qualified Data.ByteString               as S
 import qualified Data.ByteString.Internal      as S
@@ -357,6 +363,24 @@
 toByteStringIO = toByteStringIOWith defaultBufferSize
 {-# INLINE toByteStringIO #-}
 
+unsafeIO :: IO a -> a
+#if MIN_VERSION_base(4,4,0)
+unsafeIO = unsafeDupablePerformIO
+#else
+unsafeIO = unsafePerformIO
+#endif
+
+-- | Run a 'Write' to produce a strict 'S.ByteString'.
+-- This is equivalent to @('toByteString' . 'fromWrite')@, but is more
+-- efficient because it uses just one appropriately-sized buffer.
+writeToByteString :: Write -> S.ByteString
+writeToByteString !w = unsafeIO $ do
+    fptr <- S.mallocByteString (getBound w)
+    len <- withForeignPtr fptr $ \ptr -> do
+        end <- runWrite w ptr
+        return $! end `minusPtr` ptr
+    return $! S.fromForeignPtr fptr 0 len
+{-# INLINE writeToByteString #-}
 
 ------------------------------------------------------------------------------
 -- Draft of new builder/put execution code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder.hs 
new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder.hs       2013-03-24 
13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder.hs       2014-09-17 
07:58:54.000000000 +0200
@@ -79,6 +79,7 @@
     , fromWrite
     , fromWriteSingleton
     , fromWriteList
+    , writeToByteString
 
     -- ** Writing 'Storable's
     , writeStorable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.3.1.1/CHANGES 
new/blaze-builder-0.3.3.4/CHANGES
--- old/blaze-builder-0.3.1.1/CHANGES   2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/CHANGES   2014-09-17 07:58:54.000000000 +0200
@@ -1,3 +1,11 @@
+* 0.3.3.0
+  - exposed the 'Buffer' constructor to enable keeping around a pool of
+    buffers.
+
+* 0.3.2.0
+  - added 'writeToByteString' to construct a strict bytestring in a single
+    step. We can actually view 'Write's as strict-bytestring builders.
+
 * 0.3.1.1
   - Changed imports of Foreign.Unsafe to make it GHC 7.8 compatible
   - -Wall clean on GHC 7.0 - 7.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.3.1.1/README.markdown 
new/blaze-builder-0.3.3.4/README.markdown
--- old/blaze-builder-0.3.1.1/README.markdown   2013-03-24 13:38:49.000000000 
+0100
+++ new/blaze-builder-0.3.3.4/README.markdown   2014-09-17 07:58:54.000000000 
+0200
@@ -4,7 +4,7 @@
 This library allows to efficiently serialize Haskell values to lazy bytestrings
 with a large average chunk size. The large average chunk size allows to make
 good use of cache prefetching in later processing steps (e.g. compression) and
-reduces the sytem call overhead when writing the resulting lazy bytestring to a
+reduces the system call overhead when writing the resulting lazy bytestring to 
a
 file or sending it over the network.
 
 This library was inspired by the module Data.Binary.Builder provided by the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/blaze-builder-0.3.1.1/benchmarks/Throughput/BlazePutMonad.hs 
new/blaze-builder-0.3.3.4/benchmarks/Throughput/BlazePutMonad.hs
--- old/blaze-builder-0.3.1.1/benchmarks/Throughput/BlazePutMonad.hs    
2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/benchmarks/Throughput/BlazePutMonad.hs    
2014-09-17 07:58:54.000000000 +0200
@@ -59,9 +59,7 @@
 import qualified Data.ByteString      as S
 import qualified Data.ByteString.Lazy as L
 
-#ifdef APPLICATIVE_IN_BASE
 import Control.Applicative
-#endif
 
 
 ------------------------------------------------------------------------
@@ -82,14 +80,12 @@
         fmap f m = Put $ let PairS a w = unPut m in PairS (f a) w
         {-# INLINE fmap #-}
 
-#ifdef APPLICATIVE_IN_BASE
 instance Applicative PutM where
         pure    = return
         m <*> k = Put $
             let PairS f w  = unPut m
                 PairS x w' = unPut k
             in PairS (f x) (w `mappend` w')
-#endif
 
 -- Standard Writer monad, with aggressive inlining
 instance Monad PutM where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.3.1.1/blaze-builder.cabal 
new/blaze-builder-0.3.3.4/blaze-builder.cabal
--- old/blaze-builder-0.3.1.1/blaze-builder.cabal       2013-03-24 
13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/blaze-builder.cabal       2014-09-17 
07:58:54.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                blaze-builder
-Version:             0.3.1.1
+Version:             0.3.3.4
 Synopsis:            Efficient buffered output.
 
 Description:         
@@ -9,12 +9,12 @@
                      Haskell values to lazy bytestrings with a large average
                      chunk size. The large average chunk size allows to make
                      good use of cache prefetching in later processing steps
-                     (e.g. compression) and reduces the sytem call overhead
+                     (e.g. compression) and reduces the system call overhead
                      when writing the resulting lazy bytestring to a file or
                      sending it over the network.
 
 Author:              Jasper Van der Jeugt, Simon Meier
-Copyright:           2010 Simon Meier
+Copyright:           2010-2014 Simon Meier
                      2010 Jasper Van der Jeugt
 Maintainer:          Simon Meier <[email protected]>
 
@@ -75,4 +75,4 @@
   
   build-depends:     base == 4.* ,
                      bytestring >= 0.9 && < 1.0 ,
-                     text >= 0.10 && < 0.13
+                     text >= 0.10 && < 1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/blaze-builder-0.3.1.1/tests/Tests.hs 
new/blaze-builder-0.3.3.4/tests/Tests.hs
--- old/blaze-builder-0.3.1.1/tests/Tests.hs    2013-03-24 13:38:49.000000000 
+0100
+++ new/blaze-builder-0.3.3.4/tests/Tests.hs    2014-09-17 07:58:54.000000000 
+0200
@@ -32,6 +32,7 @@
     , testProperty "string and text"           stringAndText
     , testProperty "lazy bytestring identity"  identityLazyByteString
     , testProperty "flushing identity"         identityFlushing
+    , testProperty "writeToByteString"         writeToByteStringProp
     , testCase     "escaping case 1"           escaping1
     , testCase     "escaping case 2"           escaping2
     , testCase     "escaping case 3"           escaping3
@@ -66,6 +67,9 @@
         b2 = fromString s2
     in b1 `mappend` b2 == b1 `mappend` flush `mappend` b2
 
+writeToByteStringProp :: Write -> Bool
+writeToByteStringProp w = toByteString (fromWrite w) == writeToByteString w
+
 escaping1 :: Assertion
 escaping1 = fromString "&lt;hello&gt;" @?= fromHtmlEscapedString "<hello>"
 
@@ -78,6 +82,9 @@
 instance Show Builder where
     show = show . toLazyByteString
 
+instance Show Write where
+    show = show . fromWrite
+
 instance Eq Builder where
     b1 == b2 =
         -- different and small buffer sizses for testing wrapping behaviour
@@ -92,5 +99,11 @@
 instance Arbitrary Builder where
     arbitrary = (mconcat . replicate numRepetitions . fromString) <$> arbitrary
 
+instance Arbitrary Write where
+    arbitrary = mconcat . map singleWrite <$> arbitrary
+      where
+        singleWrite (Left bs) = writeByteString (LB.toStrict bs)
+        singleWrite (Right w) = writeWord8 w
+
 instance Arbitrary LB.ByteString where
     arbitrary = (LB.concat . replicate numRepetitions . LB.pack) <$> arbitrary

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to