Hello community, here is the log from the commit of package ghc-text for openSUSE:Factory checked in at 2015-08-23 15:43:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-text (Old) and /work/SRC/openSUSE:Factory/.ghc-text.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-text" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-text/ghc-text.changes 2015-05-21 08:34:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-text.new/ghc-text.changes 2015-08-23 17:39:11.000000000 +0200 @@ -1,0 +2,15 @@ +Fri Aug 7 08:35:26 UTC 2015 - [email protected] + +- update to 1.2.1.3 +* Bug fix: As it turns out, moving the literal rewrite rules to simplifier phase 2 + does not prevent competition with the unpack rule, which is also active in this phase. + Unfortunately this was hidden due to a silly test environment mistake. Moving literal + rules back to phase 1 finally fixes GHC Trac #10528 correctly. +* Bug fix: Run literal rewrite rules in simplifier phase 2. The behavior of the simplifier + changed in GHC 7.10.2, causing these rules to fail to fire, leading to poor code + generation and long compilation times. See GHC Trac #10528. +* Expose unpackCString#, which you should never use. +* Added Binary instances for both Text types. (If you have previously been using + the text-binary package to get a Binary instance, it is now obsolete.) + +------------------------------------------------------------------- Old: ---- text-1.2.0.6.tar.gz New: ---- text-1.2.1.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-text.spec ++++++ --- /var/tmp/diff_new_pack.UqP5xk/_old 2015-08-23 17:39:12.000000000 +0200 +++ /var/tmp/diff_new_pack.UqP5xk/_new 2015-08-23 17:39:12.000000000 +0200 @@ -22,7 +22,7 @@ %bcond_with tests Name: ghc-text -Version: 1.2.0.6 +Version: 1.2.1.3 Release: 0 Summary: An efficient packed Unicode text type License: BSD-2-Clause ++++++ text-1.2.0.6.tar.gz -> text-1.2.1.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/Data/Text/Encoding.hs new/text-1.2.1.3/Data/Text/Encoding.hs --- old/text-1.2.0.6/Data/Text/Encoding.hs 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/Data/Text/Encoding.hs 2015-07-30 13:25:03.000000000 +0200 @@ -84,12 +84,12 @@ import Control.Monad.ST (runST) import Data.ByteString as B import Data.ByteString.Internal as B hiding (c2w) -import Data.Text () import Data.Text.Encoding.Error (OnDecodeError, UnicodeException, strictDecode) import Data.Text.Internal (Text(..), safe, text) import Data.Text.Internal.Private (runText) import Data.Text.Internal.Unsafe.Char (unsafeWrite) import Data.Text.Internal.Unsafe.Shift (shiftR) +import Data.Text.Show () import Data.Text.Unsafe (unsafeDupablePerformIO) import Data.Word (Word8, Word32) import Foreign.C.Types (CSize(..)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/Data/Text/Lazy/Encoding.hs new/text-1.2.1.3/Data/Text/Lazy/Encoding.hs --- old/text-1.2.0.6/Data/Text/Lazy/Encoding.hs 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/Data/Text/Lazy/Encoding.hs 2015-07-30 13:25:03.000000000 +0200 @@ -66,10 +66,9 @@ import qualified Data.ByteString.Builder as B import qualified Data.ByteString.Builder.Extra as B (safeStrategy, toLazyByteStringWith) import qualified Data.ByteString.Builder.Prim as BP -import qualified Data.Text as T #endif +import qualified Data.Text as T import qualified Data.Text.Encoding as TE -import qualified Data.Text.Lazy as L import qualified Data.Text.Internal.Lazy.Encoding.Fusion as E import qualified Data.Text.Internal.Lazy.Fusion as F import Data.Text.Unsafe (unsafeDupablePerformIO) @@ -110,7 +109,7 @@ | S.null l = empty | otherwise = case onErr desc (Just (B.unsafeHead l)) of Nothing -> empty - Just c -> L.singleton c + Just c -> Chunk (T.singleton c) Empty desc = "Data.Text.Lazy.Encoding.decodeUtf8With: Invalid UTF-8 stream" decodeUtf8With _ _ = empty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/Data/Text/Lazy.hs new/text-1.2.1.3/Data/Text/Lazy.hs --- old/text-1.2.0.6/Data/Text/Lazy.hs 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/Data/Text/Lazy.hs 2015-07-30 13:25:03.000000000 +0200 @@ -212,6 +212,7 @@ import Data.Char (isSpace) import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf), constrIndex, Constr, mkConstr, DataType, mkDataType, Fixity(Prefix)) +import Data.Binary (Binary(get, put)) import Data.Monoid (Monoid(..)) import Data.String (IsString(..)) import qualified Data.Text as T @@ -224,6 +225,7 @@ import Data.Text.Internal.Lazy (Text(..), chunk, empty, foldlChunks, foldrChunks, smallChunkSize) import Data.Text.Internal (firstf, safe, text) +import Data.Text.Lazy.Encoding (decodeUtf8, encodeUtf8) import qualified Data.Text.Internal.Functions as F import Data.Text.Internal.Lazy.Search (indices) #if __GLASGOW_HASKELL__ >= 702 @@ -353,6 +355,10 @@ rnf (Chunk _ ts) = rnf ts #endif +instance Binary Text where + put t = put (encodeUtf8 t) + get = P.fmap decodeUtf8 get + -- | This instance preserves data abstraction at the cost of inefficiency. -- We omit reflection services for the sake of data abstraction. -- @@ -961,7 +967,7 @@ -- | @'iterate' f x@ returns an infinite 'Text' of repeated applications -- of @f@ to @x@: --- +-- -- > iterate f x == [x, f x, f (f x), ...] iterate :: (Char -> Char) -> Char -> Text iterate f c = let t c' = Chunk (T.singleton c') (t (f c')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/Data/Text/Show.hs new/text-1.2.1.3/Data/Text/Show.hs --- old/text-1.2.0.6/Data/Text/Show.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/text-1.2.1.3/Data/Text/Show.hs 2015-07-30 13:25:03.000000000 +0200 @@ -0,0 +1,89 @@ +{-# LANGUAGE CPP, MagicHash #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +#if __GLASGOW_HASKELL__ >= 702 +{-# LANGUAGE Trustworthy #-} +#endif + +-- | +-- Module : Data.Text.Show +-- Copyright : (c) 2009-2015 Bryan O'Sullivan +-- +-- License : BSD-style +-- Maintainer : [email protected] +-- Stability : experimental +-- Portability : GHC + +module Data.Text.Show + ( + singleton + , unpack + , unpackCString# + ) where + +import Control.Monad.ST (ST) +import Data.Text.Internal (Text(..), empty_, safe) +import Data.Text.Internal.Fusion (stream, unstream) +import Data.Text.Internal.Unsafe.Char (unsafeWrite) +import GHC.Prim (Addr#) +import qualified Data.Text.Array as A +import qualified Data.Text.Internal.Fusion.Common as S + +#if __GLASGOW_HASKELL__ >= 702 +import qualified GHC.CString as GHC +#else +import qualified GHC.Base as GHC +#endif + +instance Show Text where + showsPrec p ps r = showsPrec p (unpack ps) r + +-- | /O(n)/ Convert a 'Text' into a 'String'. Subject to fusion. +unpack :: Text -> String +unpack = S.unstreamList . stream +{-# INLINE [1] unpack #-} + +-- | /O(n)/ Convert a literal string into a 'Text'. Subject to +-- fusion. +-- +-- This is exposed solely for people writing GHC rewrite rules. +unpackCString# :: Addr# -> Text +unpackCString# addr# = unstream (S.streamCString# addr#) +{-# NOINLINE unpackCString# #-} + +{-# RULES "TEXT literal" [1] forall a. + unstream (S.map safe (S.streamList (GHC.unpackCString# a))) + = unpackCString# a #-} + +{-# RULES "TEXT literal UTF8" [1] forall a. + unstream (S.map safe (S.streamList (GHC.unpackCStringUtf8# a))) + = unpackCString# a #-} + +{-# RULES "TEXT empty literal" [1] + unstream (S.map safe (S.streamList [])) + = empty_ #-} + +{-# RULES "TEXT singleton literal" [1] forall a. + unstream (S.map safe (S.streamList [a])) + = singleton_ a #-} + +-- | /O(1)/ Convert a character into a Text. Subject to fusion. +-- Performs replacement on invalid scalar values. +singleton :: Char -> Text +singleton = unstream . S.singleton . safe +{-# INLINE [1] singleton #-} + +{-# RULES "TEXT singleton" forall a. + unstream (S.singleton (safe a)) + = singleton_ a #-} + +-- This is intended to reduce inlining bloat. +singleton_ :: Char -> Text +singleton_ c = Text (A.run x) 0 len + where x :: ST s (A.MArray s) + x = do arr <- A.new len + _ <- unsafeWrite arr 0 d + return arr + len | d < '\x10000' = 1 + | otherwise = 2 + d = safe c +{-# NOINLINE singleton_ #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/Data/Text.hs new/text-1.2.1.3/Data/Text.hs --- old/text-1.2.0.6/Data/Text.hs 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/Data/Text.hs 2015-07-30 13:25:03.000000000 +0200 @@ -191,11 +191,12 @@ -- * Low level operations , copy + , unpackCString# ) where import Prelude (Char, Bool(..), Int, Maybe(..), String, Eq(..), Ord(..), Ordering(..), (++), - Read(..), Show(..), + Read(..), (&&), (||), (+), (-), (.), ($), ($!), (>>), not, return, otherwise, quot) #if defined(HAVE_DEEPSEQ) @@ -211,17 +212,20 @@ import Control.Monad.ST (ST) import qualified Data.Text.Array as A import qualified Data.List as L +import Data.Binary (Binary(get, put)) import Data.Monoid (Monoid(..)) import Data.String (IsString(..)) import qualified Data.Text.Internal.Fusion as S import qualified Data.Text.Internal.Fusion.Common as S +import Data.Text.Encoding (decodeUtf8, encodeUtf8) import Data.Text.Internal.Fusion (stream, reverseStream, unstream) import Data.Text.Internal.Private (span_) -import Data.Text.Internal (Text(..), empty, empty_, firstf, mul, safe, text) +import Data.Text.Internal (Text(..), empty, firstf, mul, safe, text) +import Data.Text.Show (singleton, unpack, unpackCString#) import qualified Prelude as P import Data.Text.Unsafe (Iter(..), iter, iter_, lengthWord16, reverseIter, reverseIter_, unsafeHead, unsafeTail) -import Data.Text.Internal.Unsafe.Char (unsafeChr, unsafeWrite) +import Data.Text.Internal.Unsafe.Char (unsafeChr) import qualified Data.Text.Internal.Functions as F import qualified Data.Text.Internal.Encoding.Utf16 as U16 import Data.Text.Internal.Search (indices) @@ -230,15 +234,9 @@ import qualified Data.Text.Lazy as L import Data.Int (Int64) #endif -#if __GLASGOW_HASKELL__ >= 702 -import qualified GHC.CString as GHC -#else -import qualified GHC.Base as GHC -#endif #if __GLASGOW_HASKELL__ >= 708 import qualified GHC.Exts as Exts #endif -import GHC.Prim (Addr#) -- $strict -- @@ -324,9 +322,6 @@ instance Ord Text where compare = compareText -instance Show Text where - showsPrec p ps r = showsPrec p (unpack ps) r - instance Read Text where readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str] @@ -349,6 +344,10 @@ instance NFData Text where rnf !_ = () #endif +instance Binary Text where + put t = put (encodeUtf8 t) + get = P.fmap decodeUtf8 get + -- | This instance preserves data abstraction at the cost of inefficiency. -- We omit reflection services for the sake of data abstraction. -- @@ -401,54 +400,6 @@ pack = unstream . S.map safe . S.streamList {-# INLINE [1] pack #-} --- | /O(n)/ Convert a 'Text' into a 'String'. Subject to fusion. -unpack :: Text -> String -unpack = S.unstreamList . stream -{-# INLINE [1] unpack #-} - --- | /O(n)/ Convert a literal string into a Text. Subject to fusion. -unpackCString# :: Addr# -> Text -unpackCString# addr# = unstream (S.streamCString# addr#) -{-# NOINLINE unpackCString# #-} - -{-# RULES "TEXT literal" forall a. - unstream (S.map safe (S.streamList (GHC.unpackCString# a))) - = unpackCString# a #-} - -{-# RULES "TEXT literal UTF8" forall a. - unstream (S.map safe (S.streamList (GHC.unpackCStringUtf8# a))) - = unpackCString# a #-} - -{-# RULES "TEXT empty literal" - unstream (S.map safe (S.streamList [])) - = empty_ #-} - -{-# RULES "TEXT singleton literal" forall a. - unstream (S.map safe (S.streamList [a])) - = singleton_ a #-} - --- | /O(1)/ Convert a character into a Text. Subject to fusion. --- Performs replacement on invalid scalar values. -singleton :: Char -> Text -singleton = unstream . S.singleton . safe -{-# INLINE [1] singleton #-} - -{-# RULES "TEXT singleton" forall a. - unstream (S.singleton (safe a)) - = singleton_ a #-} - --- This is intended to reduce inlining bloat. -singleton_ :: Char -> Text -singleton_ c = Text (A.run x) 0 len - where x :: ST s (A.MArray s) - x = do arr <- A.new len - _ <- unsafeWrite arr 0 d - return arr - len | d < '\x10000' = 1 - | otherwise = 2 - d = safe c -{-# NOINLINE singleton_ #-} - -- ----------------------------------------------------------------------------- -- * Basic functions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/changelog.md new/text-1.2.1.3/changelog.md --- old/text-1.2.0.6/changelog.md 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/changelog.md 2015-07-30 13:25:03.000000000 +0200 @@ -1,3 +1,33 @@ +1.2.1.3 + +* Bug fix: As it turns out, moving the literal rewrite rules to simplifier + phase 2 does not prevent competition with the `unpack` rule, which is + also active in this phase. Unfortunately this was hidden due to a silly + test environment mistake. Moving literal rules back to phase 1 finally + fixes GHC Trac #10528 correctly. + +1.2.1.2 + +* Bug fix: Run literal rewrite rules in simplifier phase 2. + The behavior of the simplifier changed in GHC 7.10.2, + causing these rules to fail to fire, leading to poor code generation + and long compilation times. See + [GHC Trac #10528](https://ghc.haskell.org/trac/ghc/ticket/10528). + +1.2.1.1 + +* Expose unpackCString#, which you should never use. + +1.2.1.0 + +* Added Binary instances for both Text types. (If you have previously + been using the text-binary package to get a Binary instance, it is + now obsolete.) + +1.2.0.6 + +* Fixed a space leak in UTF-8 decoding + 1.2.0.5 * Feature parity: repeat, cycle, iterate are now implemented for lazy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/tests/LiteralRuleTest.hs new/text-1.2.1.3/tests/LiteralRuleTest.hs --- old/text-1.2.0.6/tests/LiteralRuleTest.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/text-1.2.1.3/tests/LiteralRuleTest.hs 2015-07-30 13:25:03.000000000 +0200 @@ -0,0 +1,21 @@ +{-# LANGUAGE OverloadedStrings #-} + +module LiteralRuleTest where + +import Data.Text (Text) + +-- This should produce 8 firings of the "TEXT literal" rule +strings :: [Text] +strings = [ "abstime", "aclitem", "bit", "bool", "box", "bpchar", "bytea", "char" ] + +-- This should produce 7 firings of the "TEXT literal UTF8" rule +utf8Strings :: [Text] +utf8Strings = [ "\0abstime", "\0aclitem", "\xfefe bit", "\0bool", "\0box", "\0bpchar", "\0bytea" ] + +-- This should produce 4 firings of the "TEXT empty literal" rule +empties :: [Text] +empties = [ "", "", "", "" ] + +-- This should produce 5 firings of the "TEXT empty literal" rule +--singletons :: [Text] +--singletons = [ "a", "b", "c", "d", "e" ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/tests/Makefile new/text-1.2.1.3/tests/Makefile --- old/text-1.2.0.6/tests/Makefile 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/tests/Makefile 2015-07-30 13:25:03.000000000 +0200 @@ -1,5 +1,10 @@ count = 1000 +all: coverage literal-rule-test + +literal-rule-test: + ./literal-rule-test.sh + coverage: build coverage/hpc_index.html build: text-test-data @@ -32,4 +37,4 @@ clean: rm -rf dist coverage .hpc -.PHONY: build coverage +.PHONY: build coverage all literal-rule-test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/tests/text-tests.cabal new/text-1.2.1.3/tests/text-tests.cabal --- old/text-1.2.0.6/tests/text-tests.cabal 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/tests/text-tests.cabal 2015-07-30 13:25:03.000000000 +0200 @@ -114,6 +114,7 @@ Data.Text.Internal.Lazy.Search Data.Text.Internal.Private Data.Text.Read + Data.Text.Show Data.Text.Internal.Read Data.Text.Internal.Search Data.Text.Unsafe @@ -135,6 +136,7 @@ build-depends: array, base == 4.*, + binary, bytestring, deepseq, ghc-prim, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-1.2.0.6/text.cabal new/text-1.2.1.3/text.cabal --- old/text-1.2.0.6/text.cabal 2015-05-15 18:27:51.000000000 +0200 +++ new/text-1.2.1.3/text.cabal 2015-07-30 13:25:03.000000000 +0200 @@ -1,5 +1,5 @@ name: text -version: 1.2.0.6 +version: 1.2.1.3 homepage: https://github.com/bos/text bug-reports: https://github.com/bos/text/issues synopsis: An efficient packed Unicode text type. @@ -121,9 +121,13 @@ Data.Text.Read Data.Text.Unsafe + other-modules: + Data.Text.Show + build-depends: array >= 0.3, base >= 4.2 && < 5, + binary, deepseq >= 1.1.0.0, ghc-prim >= 0.2 @@ -136,6 +140,7 @@ ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 if flag(developer) ghc-prof-options: -auto-all + ghc-options: -Werror cpp-options: -DASSERTS if flag(integer-simple) @@ -163,6 +168,7 @@ QuickCheck >= 2.7, array, base, + binary, bytestring, deepseq, directory,
