Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-streaming-commons for
openSUSE:Factory checked in at 2022-02-11 23:09:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-streaming-commons (Old)
and /work/SRC/openSUSE:Factory/.ghc-streaming-commons.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-streaming-commons"
Fri Feb 11 23:09:41 2022 rev:25 rq:953536 version:0.2.2.4
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-streaming-commons/ghc-streaming-commons.changes
2021-12-19 17:34:20.212260729 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-streaming-commons.new.1956/ghc-streaming-commons.changes
2022-02-11 23:11:40.575339335 +0100
@@ -1,0 +2,12 @@
+Sun Feb 6 09:23:47 UTC 2022 - Peter Simons <[email protected]>
+
+- Update streaming-commons to version 0.2.2.4.
+ ## 0.2.2.4
+
+ * Fix docstrings for text 2.0
+
+ ## 0.2.2.3
+
+ * Support text 2.0 [#65](https://github.com/fpco/streaming-commons/pull/65)
+
+-------------------------------------------------------------------
Old:
----
streaming-commons-0.2.2.2.tar.gz
New:
----
streaming-commons-0.2.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-streaming-commons.spec ++++++
--- /var/tmp/diff_new_pack.2PEiVo/_old 2022-02-11 23:11:41.047340700 +0100
+++ /var/tmp/diff_new_pack.2PEiVo/_new 2022-02-11 23:11:41.055340722 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-streaming-commons
#
-# 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,7 +19,7 @@
%global pkg_name streaming-commons
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.2.2
+Version: 0.2.2.4
Release: 0
Summary: Common lower-level functions needed by various streaming data
libraries
License: MIT
++++++ streaming-commons-0.2.2.2.tar.gz -> streaming-commons-0.2.2.4.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.2.2/ChangeLog.md
new/streaming-commons-0.2.2.4/ChangeLog.md
--- old/streaming-commons-0.2.2.2/ChangeLog.md 2021-11-09 09:15:15.000000000
+0100
+++ new/streaming-commons-0.2.2.4/ChangeLog.md 2022-02-06 10:23:07.000000000
+0100
@@ -1,5 +1,13 @@
# ChangeLog for streaming-commons
+## 0.2.2.4
+
+* Fix docstrings for text 2.0
+
+## 0.2.2.3
+
+* Support text 2.0 [#65](https://github.com/fpco/streaming-commons/pull/65)
+
## 0.2.2.2
* Support GHC 9.2 [#62](https://github.com/fpco/streaming-commons/pull/62)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.2.2/Data/Streaming/Text.hs
new/streaming-commons-0.2.2.4/Data/Streaming/Text.hs
--- old/streaming-commons-0.2.2.2/Data/Streaming/Text.hs 2021-11-09
09:14:37.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Streaming/Text.hs 2022-02-06
10:22:50.000000000 +0100
@@ -4,6 +4,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnliftedFFITypes #-}
--
@@ -48,7 +49,7 @@
import Control.Monad.ST (ST, runST)
import Control.Monad.ST.Unsafe (unsafeIOToST, unsafeSTToIO)
-import Data.Bits ((.|.))
+import Data.Bits ((.|.), shiftL)
import qualified Data.ByteString as B
import Data.ByteString.Internal (ByteString (PS))
import qualified Data.ByteString.Unsafe as B
@@ -59,10 +60,8 @@
import qualified Data.Text.Internal.Encoding.Utf16 as U16
import qualified Data.Text.Internal.Encoding.Utf32 as U32
import qualified Data.Text.Internal.Encoding.Utf8 as U8
-import Data.Text.Internal.Unsafe.Char (unsafeChr, unsafeChr32,
+import Data.Text.Internal.Unsafe.Char (unsafeWrite, unsafeChr32,
unsafeChr8)
-import Data.Text.Internal.Unsafe.Char (unsafeWrite)
-import Data.Text.Internal.Unsafe.Shift (shiftL)
import Data.Word (Word32, Word8)
import Foreign.C.Types (CSize (..))
import Foreign.ForeignPtr (withForeignPtr)
@@ -72,6 +71,17 @@
import Foreign.Storable (Storable, peek, poke)
import GHC.Base (MutableByteArray#)
+#if MIN_VERSION_text(2,0,0)
+import Control.Exception (try, evaluate)
+import qualified Data.Text.Encoding as TE
+import qualified Data.Text.Encoding.Error as TE
+import Data.Text.Internal.Unsafe.Char (unsafeChr16)
+import System.IO.Unsafe (unsafePerformIO)
+#else
+import Data.Text.Internal.Unsafe.Char (unsafeChr)
+unsafeChr16 = unsafeChr
+#endif
+
data S = S0
| S1 {-# UNPACK #-} !Word8
| S2 {-# UNPACK #-} !Word8 {-# UNPACK #-} !Word8
@@ -108,6 +118,16 @@
-- | /O(n)/ Convert a 'ByteString' into a 'Stream Char', using
-- UTF-8 encoding.
decodeUtf8 :: B.ByteString -> DecodeResult
+#if MIN_VERSION_text(2,0,0)
+decodeUtf8 = go mempty TE.streamDecodeUtf8
+ where
+ go :: B.ByteString -> (B.ByteString -> TE.Decoding) -> B.ByteString ->
DecodeResult
+ go prev decoder curr = case unsafePerformIO (try (evaluate (decoder
curr))) of
+ -- Caught exception does not allow to reconstruct 'DecodeResultFailure',
+ -- so delegating this to 'decodeUtf8Pure'
+ Left (_ :: TE.UnicodeException) -> decodeUtf8Pure (prev <> curr)
+ Right (TE.Some decoded undecoded cont) -> DecodeResultSuccess decoded
(go undecoded cont)
+#else
decodeUtf8 = decodeChunk B.empty 0 0
where
decodeChunkCheck :: B.ByteString -> CodePoint -> DecoderState ->
B.ByteString -> DecodeResult
@@ -158,6 +178,7 @@
return $! DecodeResultSuccess chunkText
$! decodeChunkCheck unused codepoint state
in loop (ptr `plusPtr` off)
+#endif
-- | /O(n)/ Convert a 'ByteString' into a 'Stream Char', using
-- UTF-8 encoding.
@@ -172,7 +193,13 @@
_ -> DecodeResultFailure T.empty $ toBS s
beginChunk s0 ps = runST $ do
let initLen = B.length ps
+#if MIN_VERSION_text(2,0,0)
+ -- Worst-case scenario: the very first byte finishes a 4-byte sequence,
+ -- so decoding results in 4 + (initLen - 1) bytes.
+ marr <- A.new (initLen + 3)
+#else
marr <- A.new (initLen + 1)
+#endif
let start !i !j
| i >= len = do
t <- getText j marr
@@ -237,12 +264,18 @@
_ -> DecodeResultFailure T.empty $ toBS s
beginChunk s0 ps = runST $ do
let initLen = B.length ps
- marr <- A.new (initLen + 1)
+#if MIN_VERSION_text(2,0,0)
+ -- Worst-case scenario: each Word16 in UTF16 gives three Word8 in UTF8
+ -- and left-over from a previous chunk gives four Word8 in UTF8
+ marr <- A.new ((initLen `div` 2) * 3 + 4) -- of Word8
+#else
+ marr <- A.new (initLen + 1) -- of Word16
+#endif
let start !i !j
| i >= len = do
t <- getText j marr
return $! DecodeResultSuccess t (beginChunk S0)
- | i + 1 < len && U16.validate1 x1 = addChar' 2 (unsafeChr
x1)
+ | i + 1 < len && U16.validate1 x1 = addChar' 2 (unsafeChr16
x1)
| i + 3 < len && U16.validate2 x1 x2 = addChar' 4 (U16.chr2 x1
x2)
| i + 3 < len = do
t <- getText j marr
@@ -271,7 +304,7 @@
S1 a ->
let x1 = combine a x
in if U16.validate1 x1
- then addChar' (unsafeChr x1)
+ then addChar' (unsafeChr16 x1)
else checkCont (S2 a x) (i + 1)
S2 a b -> checkCont (S3 a b x) (i + 1)
S3 a b c ->
@@ -306,12 +339,18 @@
_ -> DecodeResultFailure T.empty $ toBS s
beginChunk s0 ps = runST $ do
let initLen = B.length ps
- marr <- A.new (initLen + 1)
+#if MIN_VERSION_text(2,0,0)
+ -- Worst-case scenario: each Word16 in UTF16 gives three Word8 in UTF8
+ -- and left-over from a previous chunk gives four Word8 in UTF8
+ marr <- A.new ((initLen `div` 2) * 3 + 4) -- of Word8
+#else
+ marr <- A.new (initLen + 1) -- of Word16
+#endif
let start !i !j
| i >= len = do
t <- getText j marr
return $! DecodeResultSuccess t (beginChunk S0)
- | i + 1 < len && U16.validate1 x1 = addChar' 2 (unsafeChr
x1)
+ | i + 1 < len && U16.validate1 x1 = addChar' 2 (unsafeChr16
x1)
| i + 3 < len && U16.validate2 x1 x2 = addChar' 4 (U16.chr2 x1
x2)
| i + 3 < len = do
t <- getText j marr
@@ -340,7 +379,7 @@
S1 a ->
let x1 = combine a x
in if U16.validate1 x1
- then addChar' (unsafeChr x1)
+ then addChar' (unsafeChr16 x1)
else checkCont (S2 a x) (i + 1)
S2 a b -> checkCont (S3 a b x) (i + 1)
S3 a b c ->
@@ -375,7 +414,14 @@
_ -> DecodeResultFailure T.empty $ toBS s
beginChunk s0 ps = runST $ do
let initLen = B.length ps `div` 2
- marr <- A.new (initLen + 1)
+#if MIN_VERSION_text(2,0,0)
+ -- Worst-case scenario: the very first byte finishes a 4-byte UTF8
sequence,
+ -- and other codepoints have 4-byte UTF8 representation as well.
+ -- This gives 4 + (B.length ps - 1), or (for odd B.length) initLen * 2
+ 4.
+ marr <- A.new (initLen * 2 + 4) -- of Word8
+#else
+ marr <- A.new (initLen + 1) -- of Word16
+#endif
let start !i !j
| i >= len = do
t <- getText j marr
@@ -441,7 +487,14 @@
_ -> DecodeResultFailure T.empty $ toBS s
beginChunk s0 ps = runST $ do
let initLen = B.length ps `div` 2
- marr <- A.new (initLen + 1)
+#if MIN_VERSION_text(2,0,0)
+ -- Worst-case scenario: the very first byte finishes a 4-byte UTF8
sequence,
+ -- and other codepoints have 4-byte UTF8 representation as well.
+ -- This gives 4 + (B.length ps - 1), or (for odd B.length) initLen * 2
+ 4.
+ marr <- A.new (initLen * 2 + 4) -- of Word8
+#else
+ marr <- A.new (initLen + 1) -- of Word16
+#endif
let start !i !j
| i >= len = do
t <- getText j marr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf16.hs
new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf16.hs
--- old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf16.hs
2021-11-09 09:14:45.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf16.hs
1970-01-01 01:00:00.000000000 +0100
@@ -1,54 +0,0 @@
-{-# LANGUAGE CPP #-}
-{-# LANGUAGE MagicHash, BangPatterns #-}
-
--- |
--- Module : Data.Text.Internal.Encoding.Utf16
--- Copyright : (c) 2008, 2009 Tom Harper,
--- (c) 2009 Bryan O'Sullivan,
--- (c) 2009 Duncan Coutts
---
--- License : BSD-style
--- Maintainer : [email protected]
--- Stability : experimental
--- Portability : GHC
---
--- /Warning/: this is an internal module, and does not have a stable
--- API or name. Functions in this module may not check or enforce
--- preconditions expected by public modules. Use at your own risk!
---
--- Basic UTF-16 validation and character manipulation.
-module Data.Text.Internal.Encoding.Utf16
- (
- chr2
- , validate1
- , validate2
- ) where
-
-import GHC.Exts
-import GHC.Word (Word16(..))
-
-chr2 :: Word16 -> Word16 -> Char
-chr2 (W16# a#) (W16# b#) = C# (chr# (upper# +# lower# +# 0x10000#))
- where
- !x# = word2Int# (word16ToWordCompat# a#)
- !y# = word2Int# (word16ToWordCompat# b#)
- !upper# = uncheckedIShiftL# (x# -# 0xD800#) 10#
- !lower# = y# -# 0xDC00#
-{-# INLINE chr2 #-}
-
-validate1 :: Word16 -> Bool
-validate1 x1 = x1 < 0xD800 || x1 > 0xDFFF
-{-# INLINE validate1 #-}
-
-validate2 :: Word16 -> Word16 -> Bool
-validate2 x1 x2 = x1 >= 0xD800 && x1 <= 0xDBFF &&
- x2 >= 0xDC00 && x2 <= 0xDFFF
-{-# INLINE validate2 #-}
-
-#if MIN_VERSION_base(4,16,0)
-word16ToWordCompat# :: Word16# -> Word#
-word16ToWordCompat# = word16ToWord#
-#else
-word16ToWordCompat# :: Word# -> Word#
-word16ToWordCompat# x = x
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf32.hs
new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf32.hs
--- old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf32.hs
2021-11-09 09:14:37.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf32.hs
1970-01-01 01:00:00.000000000 +0100
@@ -1,26 +0,0 @@
--- |
--- Module : Data.Text.Internal.Encoding.Utf32
--- Copyright : (c) 2008, 2009 Tom Harper,
--- (c) 2009, 2010 Bryan O'Sullivan,
--- (c) 2009 Duncan Coutts
---
--- License : BSD-style
--- Maintainer : [email protected]
--- Stability : experimental
--- Portability : portable
---
--- /Warning/: this is an internal module, and does not have a stable
--- API or name. Functions in this module may not check or enforce
--- preconditions expected by public modules. Use at your own risk!
---
--- Basic UTF-32 validation.
-module Data.Text.Internal.Encoding.Utf32
- (
- validate
- ) where
-
-import Data.Word (Word32)
-
-validate :: Word32 -> Bool
-validate x1 = x1 < 0xD800 || (x1 > 0xDFFF && x1 <= 0x10FFFF)
-{-# INLINE validate #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf8.hs
new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf8.hs
--- old/streaming-commons-0.2.2.2/Data/Text/Internal/Encoding/Utf8.hs
2021-11-09 09:14:45.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Text/Internal/Encoding/Utf8.hs
1970-01-01 01:00:00.000000000 +0100
@@ -1,176 +0,0 @@
-{-# LANGUAGE CPP, MagicHash, BangPatterns #-}
-
--- |
--- Module : Data.Text.Internal.Encoding.Utf8
--- Copyright : (c) 2008, 2009 Tom Harper,
--- (c) 2009, 2010 Bryan O'Sullivan,
--- (c) 2009 Duncan Coutts
---
--- License : BSD-style
--- Maintainer : [email protected]
--- Stability : experimental
--- Portability : GHC
---
--- /Warning/: this is an internal module, and does not have a stable
--- API or name. Functions in this module may not check or enforce
--- preconditions expected by public modules. Use at your own risk!
---
--- Basic UTF-8 validation and character manipulation.
-module Data.Text.Internal.Encoding.Utf8
- (
- -- Decomposition
- ord2
- , ord3
- , ord4
- -- Construction
- , chr2
- , chr3
- , chr4
- -- * Validation
- , validate1
- , validate2
- , validate3
- , validate4
- ) where
-
-#if defined(TEST_SUITE)
-# undef ASSERTS
-#endif
-
-#if defined(ASSERTS)
-import Control.Exception (assert)
-#endif
-import Data.Bits ((.&.))
-import Data.Text.Internal.Unsafe.Char (ord)
-import Data.Text.Internal.Unsafe.Shift (shiftR)
-import GHC.Exts
-import GHC.Word (Word8(..))
-
-default(Int)
-
-between :: Word8 -- ^ byte to check
- -> Word8 -- ^ lower bound
- -> Word8 -- ^ upper bound
- -> Bool
-between x y z = x >= y && x <= z
-{-# INLINE between #-}
-
-ord2 :: Char -> (Word8,Word8)
-ord2 c =
-#if defined(ASSERTS)
- assert (n >= 0x80 && n <= 0x07ff)
-#endif
- (x1,x2)
- where
- n = ord c
- x1 = fromIntegral $ (n `shiftR` 6) + 0xC0
- x2 = fromIntegral $ (n .&. 0x3F) + 0x80
-
-ord3 :: Char -> (Word8,Word8,Word8)
-ord3 c =
-#if defined(ASSERTS)
- assert (n >= 0x0800 && n <= 0xffff)
-#endif
- (x1,x2,x3)
- where
- n = ord c
- x1 = fromIntegral $ (n `shiftR` 12) + 0xE0
- x2 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
- x3 = fromIntegral $ (n .&. 0x3F) + 0x80
-
-ord4 :: Char -> (Word8,Word8,Word8,Word8)
-ord4 c =
-#if defined(ASSERTS)
- assert (n >= 0x10000)
-#endif
- (x1,x2,x3,x4)
- where
- n = ord c
- x1 = fromIntegral $ (n `shiftR` 18) + 0xF0
- x2 = fromIntegral $ ((n `shiftR` 12) .&. 0x3F) + 0x80
- x3 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
- x4 = fromIntegral $ (n .&. 0x3F) + 0x80
-
-chr2 :: Word8 -> Word8 -> Char
-chr2 (W8# x1#) (W8# x2#) = C# (chr# (z1# +# z2#))
- where
- !y1# = word2Int# (word8ToWordCompat# x1#)
- !y2# = word2Int# (word8ToWordCompat# x2#)
- !z1# = uncheckedIShiftL# (y1# -# 0xC0#) 6#
- !z2# = y2# -# 0x80#
-{-# INLINE chr2 #-}
-
-chr3 :: Word8 -> Word8 -> Word8 -> Char
-chr3 (W8# x1#) (W8# x2#) (W8# x3#) = C# (chr# (z1# +# z2# +# z3#))
- where
- !y1# = word2Int# (word8ToWordCompat# x1#)
- !y2# = word2Int# (word8ToWordCompat# x2#)
- !y3# = word2Int# (word8ToWordCompat# x3#)
- !z1# = uncheckedIShiftL# (y1# -# 0xE0#) 12#
- !z2# = uncheckedIShiftL# (y2# -# 0x80#) 6#
- !z3# = y3# -# 0x80#
-{-# INLINE chr3 #-}
-
-chr4 :: Word8 -> Word8 -> Word8 -> Word8 -> Char
-chr4 (W8# x1#) (W8# x2#) (W8# x3#) (W8# x4#) =
- C# (chr# (z1# +# z2# +# z3# +# z4#))
- where
- !y1# = word2Int# (word8ToWordCompat# x1#)
- !y2# = word2Int# (word8ToWordCompat# x2#)
- !y3# = word2Int# (word8ToWordCompat# x3#)
- !y4# = word2Int# (word8ToWordCompat# x4#)
- !z1# = uncheckedIShiftL# (y1# -# 0xF0#) 18#
- !z2# = uncheckedIShiftL# (y2# -# 0x80#) 12#
- !z3# = uncheckedIShiftL# (y3# -# 0x80#) 6#
- !z4# = y4# -# 0x80#
-{-# INLINE chr4 #-}
-
-validate1 :: Word8 -> Bool
-validate1 x1 = x1 <= 0x7F
-{-# INLINE validate1 #-}
-
-validate2 :: Word8 -> Word8 -> Bool
-validate2 x1 x2 = between x1 0xC2 0xDF && between x2 0x80 0xBF
-{-# INLINE validate2 #-}
-
-validate3 :: Word8 -> Word8 -> Word8 -> Bool
-{-# INLINE validate3 #-}
-validate3 x1 x2 x3 = validate3_1 || validate3_2 || validate3_3 || validate3_4
- where
- validate3_1 = (x1 == 0xE0) &&
- between x2 0xA0 0xBF &&
- between x3 0x80 0xBF
- validate3_2 = between x1 0xE1 0xEC &&
- between x2 0x80 0xBF &&
- between x3 0x80 0xBF
- validate3_3 = x1 == 0xED &&
- between x2 0x80 0x9F &&
- between x3 0x80 0xBF
- validate3_4 = between x1 0xEE 0xEF &&
- between x2 0x80 0xBF &&
- between x3 0x80 0xBF
-
-validate4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool
-{-# INLINE validate4 #-}
-validate4 x1 x2 x3 x4 = validate4_1 || validate4_2 || validate4_3
- where
- validate4_1 = x1 == 0xF0 &&
- between x2 0x90 0xBF &&
- between x3 0x80 0xBF &&
- between x4 0x80 0xBF
- validate4_2 = between x1 0xF1 0xF3 &&
- between x2 0x80 0xBF &&
- between x3 0x80 0xBF &&
- between x4 0x80 0xBF
- validate4_3 = x1 == 0xF4 &&
- between x2 0x80 0x8F &&
- between x3 0x80 0xBF &&
- between x4 0x80 0xBF
-
-#if MIN_VERSION_base(4,16,0)
-word8ToWordCompat# :: Word8# -> Word#
-word8ToWordCompat# = word8ToWord#
-#else
-word8ToWordCompat# :: Word# -> Word#
-word8ToWordCompat# x = x
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.2.2/Data/Text/Internal/Unsafe/Char.hs
new/streaming-commons-0.2.2.4/Data/Text/Internal/Unsafe/Char.hs
--- old/streaming-commons-0.2.2.2/Data/Text/Internal/Unsafe/Char.hs
2021-11-09 09:14:45.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Text/Internal/Unsafe/Char.hs
1970-01-01 01:00:00.000000000 +0100
@@ -1,119 +0,0 @@
-{-# LANGUAGE CPP, MagicHash #-}
-
--- |
--- Module : Data.Text.Internal.Unsafe.Char
--- Copyright : (c) 2008, 2009 Tom Harper,
--- (c) 2009, 2010 Bryan O'Sullivan,
--- (c) 2009 Duncan Coutts
---
--- License : BSD-style
--- Maintainer : [email protected]
--- Stability : experimental
--- Portability : GHC
---
--- /Warning/: this is an internal module, and does not have a stable
--- API or name. Functions in this module may not check or enforce
--- preconditions expected by public modules. Use at your own risk!
---
--- Fast character manipulation functions.
-module Data.Text.Internal.Unsafe.Char
- (
- ord
- , unsafeChr
- , unsafeChr8
- , unsafeChr32
- , unsafeWrite
- -- , unsafeWriteRev
- ) where
-
-#ifdef ASSERTS
-import Control.Exception (assert)
-#endif
-import Control.Monad.ST (ST)
-import Data.Bits ((.&.))
-import Data.Text.Internal.Unsafe.Shift (shiftR)
-import GHC.Exts (Char(..), Int(..), Word#, chr#, ord#, word2Int#)
-import GHC.Word (Word8(..), Word16(..), Word32(..))
-import qualified Data.Text.Array as A
-
-#if MIN_VERSION_base(4,16,0)
-import GHC.Exts (Word8#, Word16#, Word32#, word8ToWord#, word16ToWord#,
word32ToWord#)
-#endif
-
-ord :: Char -> Int
-ord (C# c#) = I# (ord# c#)
-{-# INLINE ord #-}
-
-unsafeChr :: Word16 -> Char
-unsafeChr (W16# w#) = C# (chr# (word2Int# (word16ToWordCompat# w#)))
-{-# INLINE unsafeChr #-}
-
-unsafeChr8 :: Word8 -> Char
-unsafeChr8 (W8# w#) = C# (chr# (word2Int# (word8ToWordCompat# w#)))
-{-# INLINE unsafeChr8 #-}
-
-unsafeChr32 :: Word32 -> Char
-unsafeChr32 (W32# w#) = C# (chr# (word2Int# (word32ToWordCompat# w#)))
-{-# INLINE unsafeChr32 #-}
-
--- | Write a character into the array at the given offset. Returns
--- the number of 'Word16's written.
-unsafeWrite :: A.MArray s -> Int -> Char -> ST s Int
-unsafeWrite marr i c
- | n < 0x10000 = do
-#if defined(ASSERTS)
- assert (i >= 0) . assert (i < A.length marr) $ return ()
-#endif
- A.unsafeWrite marr i (fromIntegral n)
- return 1
- | otherwise = do
-#if defined(ASSERTS)
- assert (i >= 0) . assert (i < A.length marr - 1) $ return ()
-#endif
- A.unsafeWrite marr i lo
- A.unsafeWrite marr (i+1) hi
- return 2
- where n = ord c
- m = n - 0x10000
- lo = fromIntegral $ (m `shiftR` 10) + 0xD800
- hi = fromIntegral $ (m .&. 0x3FF) + 0xDC00
-{-# INLINE unsafeWrite #-}
-
-{-
-unsafeWriteRev :: A.MArray s Word16 -> Int -> Char -> ST s Int
-unsafeWriteRev marr i c
- | n < 0x10000 = do
- assert (i >= 0) . assert (i < A.length marr) $
- A.unsafeWrite marr i (fromIntegral n)
- return (i-1)
- | otherwise = do
- assert (i >= 1) . assert (i < A.length marr) $
- A.unsafeWrite marr (i-1) lo
- A.unsafeWrite marr i hi
- return (i-2)
- where n = ord c
- m = n - 0x10000
- lo = fromIntegral $ (m `shiftR` 10) + 0xD800
- hi = fromIntegral $ (m .&. 0x3FF) + 0xDC00
-{-# INLINE unsafeWriteRev #-}
--}
-
-#if MIN_VERSION_base(4,16,0)
-word8ToWordCompat# :: Word8# -> Word#
-word8ToWordCompat# = word8ToWord#
-
-word16ToWordCompat# :: Word16# -> Word#
-word16ToWordCompat# = word16ToWord#
-
-word32ToWordCompat# :: Word32# -> Word#
-word32ToWordCompat# = word32ToWord#
-#else
-word8ToWordCompat# :: Word# -> Word#
-word8ToWordCompat# x = x
-
-word16ToWordCompat# :: Word# -> Word#
-word16ToWordCompat# x = x
-
-word32ToWordCompat# :: Word# -> Word#
-word32ToWordCompat# x = x
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.2.2/Data/Text/Internal/Unsafe/Shift.hs
new/streaming-commons-0.2.2.4/Data/Text/Internal/Unsafe/Shift.hs
--- old/streaming-commons-0.2.2.2/Data/Text/Internal/Unsafe/Shift.hs
2021-11-09 09:14:45.000000000 +0100
+++ new/streaming-commons-0.2.2.4/Data/Text/Internal/Unsafe/Shift.hs
1970-01-01 01:00:00.000000000 +0100
@@ -1,116 +0,0 @@
-{-# LANGUAGE CPP #-}
-{-# LANGUAGE MagicHash #-}
-
--- |
--- Module : Data.Text.Internal.Unsafe.Shift
--- Copyright : (c) Bryan O'Sullivan 2009
---
--- License : BSD-style
--- Maintainer : [email protected]
--- Stability : experimental
--- Portability : GHC
---
--- /Warning/: this is an internal module, and does not have a stable
--- API or name. Functions in this module may not check or enforce
--- preconditions expected by public modules. Use at your own risk!
---
--- Fast, unchecked bit shifting functions.
-
-module Data.Text.Internal.Unsafe.Shift
- (
- UnsafeShift(..)
- ) where
-
--- import qualified Data.Bits as Bits
-import GHC.Base
-#if __GLASGOW_HASKELL__ >= 903
- hiding (uncheckedShiftL64#, uncheckedShiftRL64#)
-#endif
-import GHC.Word
-
--- | This is a workaround for poor optimisation in GHC 6.8.2. It
--- fails to notice constant-width shifts, and adds a test and branch
--- to every shift. This imposes about a 10% performance hit.
---
--- These functions are undefined when the amount being shifted by is
--- greater than the size in bits of a machine Int#.
-class UnsafeShift a where
- shiftL :: a -> Int -> a
- shiftR :: a -> Int -> a
-
-instance UnsafeShift Word16 where
- {-# INLINE shiftL #-}
- shiftL (W16# x#) (I# i#) = W16# (narrow16WordCompat# (word16ToWordCompat#
x# `uncheckedShiftL#` i#))
-
- {-# INLINE shiftR #-}
- shiftR (W16# x#) (I# i#) = W16# (wordToWord16Compat# (word16ToWordCompat#
x# `uncheckedShiftRL#` i#))
-
-instance UnsafeShift Word32 where
- {-# INLINE shiftL #-}
- shiftL (W32# x#) (I# i#) = W32# (narrow32WordCompat# (word32ToWordCompat#
x# `uncheckedShiftL#` i#))
-
- {-# INLINE shiftR #-}
- shiftR (W32# x#) (I# i#) = W32# (wordToWord32Compat# (word32ToWordCompat#
x# `uncheckedShiftRL#` i#))
-
-instance UnsafeShift Word64 where
- {-# INLINE shiftL #-}
- shiftL (W64# x#) (I# i#) = W64# (x# `uncheckedShiftL64#` i#)
-
- {-# INLINE shiftR #-}
- shiftR (W64# x#) (I# i#) = W64# (x# `uncheckedShiftRL64#` i#)
-
-instance UnsafeShift Int where
- {-# INLINE shiftL #-}
- shiftL (I# x#) (I# i#) = I# (x# `iShiftL#` i#)
-
- {-# INLINE shiftR #-}
- shiftR (I# x#) (I# i#) = I# (x# `iShiftRA#` i#)
-
-{-
-instance UnsafeShift Integer where
- {-# INLINE shiftL #-}
- shiftL = Bits.shiftL
-
- {-# INLINE shiftR #-}
- shiftR = Bits.shiftR
--}
-
-#if MIN_VERSION_base(4,16,0)
-word16ToWordCompat# :: Word16# -> Word#
-word16ToWordCompat# = word16ToWord#
-
-word32ToWordCompat# :: Word32# -> Word#
-word32ToWordCompat# = word32ToWord#
-
-wordToWord16Compat# :: Word# -> Word16#
-wordToWord16Compat# = wordToWord16#
-
-wordToWord32Compat# :: Word# -> Word32#
-wordToWord32Compat# = wordToWord32#
-
-narrow16WordCompat# :: Word# -> Word16#
-narrow16WordCompat# = wordToWord16#
-
-narrow32WordCompat# :: Word# -> Word32#
-narrow32WordCompat# = wordToWord32#
-#else
--- No-ops
-word16ToWordCompat# :: Word# -> Word#
-word16ToWordCompat# x = x
-
-word32ToWordCompat# :: Word# -> Word#
-word32ToWordCompat# x = x
-
-wordToWord16Compat# :: Word# -> Word#
-wordToWord16Compat# x = x
-
-wordToWord32Compat# :: Word# -> Word#
-wordToWord32Compat# x = x
-
--- Actual narrowing
-narrow16WordCompat# :: Word# -> Word#
-narrow16WordCompat# = narrow16Word#
-
-narrow32WordCompat# :: Word# -> Word#
-narrow32WordCompat# = narrow32Word#
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.2.2/streaming-commons.cabal
new/streaming-commons-0.2.2.4/streaming-commons.cabal
--- old/streaming-commons-0.2.2.2/streaming-commons.cabal 2021-11-09
09:15:00.000000000 +0100
+++ new/streaming-commons-0.2.2.4/streaming-commons.cabal 2022-02-06
10:23:13.000000000 +0100
@@ -1,5 +1,5 @@
name: streaming-commons
-version: 0.2.2.2
+version: 0.2.2.4
synopsis: Common lower-level functions needed by various streaming
data libraries
description: Provides low-dependency functionality commonly needed by
various streaming data libraries, such as conduit and pipes.
homepage: https://github.com/fpco/streaming-commons
@@ -38,14 +38,6 @@
Data.Streaming.Zlib
Data.Streaming.Zlib.Lowlevel
- -- Due to cabal bugs, not making inclusion of this dependent on text version.
- -- For more information, see:
https://github.com/fpco/text-stream-decode/issues/1
- other-modules: Data.Text.Internal.Unsafe.Char
- Data.Text.Internal.Unsafe.Shift
- Data.Text.Internal.Encoding.Utf8
- Data.Text.Internal.Encoding.Utf16
- Data.Text.Internal.Encoding.Utf32
-
build-depends: base >= 4.12 && < 5
, array
, async
@@ -55,7 +47,7 @@
, random
, process
, stm
- , text
+ , text >= 1.2 && < 1.3 || >= 2.0 && < 2.1
, transformers
, zlib