Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-text-short for openSUSE:Factory checked in at 2022-02-11 23:09:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-text-short (Old) and /work/SRC/openSUSE:Factory/.ghc-text-short.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-text-short" Fri Feb 11 23:09:46 2022 rev:8 rq:953543 version:0.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-text-short/ghc-text-short.changes 2021-12-19 17:34:51.364282671 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-text-short.new.1956/ghc-text-short.changes 2022-02-11 23:11:44.971352049 +0100 @@ -1,0 +2,8 @@ +Sat Jan 1 00:37:38 UTC 2022 - Peter Simons <[email protected]> + +- Update text-short to version 0.1.5. + ## 0.1.5 + + * text-2.0 support + +------------------------------------------------------------------- Old: ---- text-short-0.1.4.tar.gz text-short.cabal New: ---- text-short-0.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-text-short.spec ++++++ --- /var/tmp/diff_new_pack.b9feoQ/_old 2022-02-11 23:11:45.423353357 +0100 +++ /var/tmp/diff_new_pack.b9feoQ/_new 2022-02-11 23:11:45.431353379 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-text-short # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,12 @@ %global pkg_name text-short %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.4 +Version: 0.1.5 Release: 0 Summary: Memory-efficient representation of Unicode text strings License: BSD-3-Clause 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 @@ -36,7 +35,6 @@ BuildRequires: ghc-text-devel ExcludeArch: %{ix86} %if %{with tests} -BuildRequires: ghc-quickcheck-instances-devel BuildRequires: ghc-tasty-devel BuildRequires: ghc-tasty-hunit-devel BuildRequires: ghc-tasty-quickcheck-devel @@ -65,7 +63,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ text-short-0.1.4.tar.gz -> text-short-0.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-short-0.1.4/ChangeLog.md new/text-short-0.1.5/ChangeLog.md --- old/text-short-0.1.4/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 +++ new/text-short-0.1.5/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,7 @@ +## 0.1.5 + + * text-2.0 support + ## 0.1.4 * Fix `fromString` for single character strings. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-short-0.1.4/src/Data/Text/Short/Internal.hs new/text-short-0.1.5/src/Data/Text/Short/Internal.hs --- old/text-short-0.1.4/src/Data/Text/Short/Internal.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/text-short-0.1.5/src/Data/Text/Short/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -126,7 +126,6 @@ import Data.Semigroup import qualified Data.String as S import qualified Data.Text as T -import qualified Data.Text.Encoding as T import Foreign.C import GHC.Base (assert, unsafeChr) import qualified GHC.CString as GHC @@ -149,6 +148,13 @@ import qualified Language.Haskell.TH.Syntax as TH +#if MIN_VERSION_text(2,0,0) +import qualified Data.Text.Internal as TI +import qualified Data.Text.Array as TA +#else +import qualified Data.Text.Encoding as T +#endif + import qualified PrimOps -- | A compact representation of Unicode strings. @@ -653,12 +659,16 @@ -- -- prop> (toText . fromText) t == t -- --- This is currently not \(\mathcal{O}(1)\) because currently 'T.Text' uses UTF-16 as its internal representation. --- In the event that 'T.Text' will change its internal representation to UTF-8 this operation will become \(\mathcal{O}(1)\). +-- This is \(\mathcal{O}(1)\) with @text-2@. +-- Previously it wasn't because 'T.Text' used UTF-16 as its internal representation. -- -- @since 0.1 toText :: ShortText -> T.Text +#if MIN_VERSION_text(2,0,0) +toText (ShortText (BSSI.SBS ba)) = TI.Text (TA.ByteArray ba) 0 (I# (GHC.Exts.sizeofByteArray# ba)) +#else toText = T.decodeUtf8 . toByteString +#endif ---- @@ -692,7 +702,22 @@ -- -- @since 0.1 fromText :: T.Text -> ShortText +#if MIN_VERSION_text(2,0,0) +fromText (TI.Text (TA.ByteArray ba) off len) = + ShortText (BSSI.SBS (case sliceByteArray (TA.ByteArray ba) off len of TA.ByteArray ba' -> ba')) + +sliceByteArray :: TA.Array -> Int -> Int -> TA.Array +sliceByteArray ta@(TA.ByteArray ba) 0 len + | len == I# (GHC.Exts.sizeofByteArray# ba) + = ta +sliceByteArray ta off len = TA.run $ do + ma <- TA.new len + TA.copyI len ma 0 ta off + return ma + +#else fromText = fromByteStringUnsafe . T.encodeUtf8 +#endif -- | \(\mathcal{O}(n)\) Construct 'ShortText' from UTF-8 encoded 'ShortByteString' -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-short-0.1.4/src-test/Tests.hs new/text-short-0.1.5/src-test/Tests.hs --- old/text-short-0.1.4/src-test/Tests.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/text-short-0.1.5/src-test/Tests.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,6 +2,7 @@ {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} #ifndef MIN_VERSION_GLASGOW_HASKELL #define MIN_VERSION_GLASGOW_HASKELL(x,y,z,w) ((x*100 + y) >= __GLASGOW_HASKELL__) @@ -14,11 +15,11 @@ import Data.Maybe import Data.Monoid import qualified Data.String as D.S +import qualified Data.ByteString as BS import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.Short as IUT import qualified Data.Text.Short.Partial as IUT -import Test.QuickCheck.Instances () import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck as QC @@ -259,3 +260,18 @@ {-# NOINLINE testLit8 #-} testLit8 :: IUT.ShortText testLit8 = "\x7f" + +------------------------------------------------------------------------------- +-- orphans +------------------------------------------------------------------------------- + +-- orphan instances to not depend on quickcheck-instances +-- which would cause cycles + +instance Arbitrary BS.ByteString where + arbitrary = BS.pack `fmap` arbitrary + shrink xs = BS.pack `fmap` shrink (BS.unpack xs) + +instance Arbitrary T.Text where + arbitrary = T.pack `fmap` arbitrary + shrink xs = T.pack `fmap` shrink (T.unpack xs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/text-short-0.1.4/text-short.cabal new/text-short-0.1.5/text-short.cabal --- old/text-short-0.1.4/text-short.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/text-short-0.1.5/text-short.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 1.18 name: text-short -version: 0.1.4 +version: 0.1.5 synopsis: Memory-efficient representation of Unicode text strings license: BSD3 license-file: LICENSE @@ -13,7 +13,7 @@ . The main difference between 'Text' and 'ShortText' is that 'ShortText' uses UTF-8 instead of UTF-16 internally and also doesn't support zero-copy slicing (thereby saving 2 words). Consequently, the memory footprint of a (boxed) 'ShortText' value is 4 words (2 words when unboxed) plus the length of the UTF-8 encoded payload. -tested-with: GHC==9.0.1, GHC==8.10.4, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==9.2.0.20210821 +tested-with: GHC==9.0.1, GHC==8.10.4, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==9.2.1 extra-source-files: ChangeLog.md Source-Repository head @@ -34,9 +34,9 @@ build-depends: base >= 4.7 && < 4.17 , bytestring >= 0.10.4 && < 0.12 - , hashable >= 1.2.6 && < 1.4 + , hashable >= 1.2.6 && < 1.5 , deepseq >= 1.3 && < 1.5 - , text >= 1.0 && < 1.3 + , text >= 1.0 && < 1.3 || >=2.0 && <2.1 , binary >= 0.7.1 && < 0.9 , ghc-prim >= 0.3.1 && < 0.9 , template-haskell >= 2.9.0.0 && <2.19 @@ -45,7 +45,7 @@ build-depends: bytestring >= 0.10.8.0 if !impl(ghc >= 8.0) - build-depends: semigroups >= 0.18.2 && < 0.20 + build-depends: semigroups >= 0.18.2 && < 0.21 -- GHC version specific PrimOps if impl(ghc >= 8.4) @@ -92,10 +92,10 @@ , text , text-short , template-haskell - -- deps which don't inherit constraints from library stanza: - , tasty >= 1.0.0 && < 1.5 + + -- deps which don't inherit constraints from library stanza: + build-depends: tasty >= 1.4 && < 1.5 , tasty-quickcheck >= 0.10 && < 0.11 , tasty-hunit >= 0.10.0 && < 0.11 - , quickcheck-instances >= 0.3.14 && < 0.4 default-language: Haskell2010
