streamly-bytestring 0.2.2 → 0.2.3
raw patch · 4 files changed
+27/−5 lines, 4 filesdep ~bytestringdep ~streamly-core
Dependency ranges changed: bytestring, streamly-core
Files
- Changelog.md +4/−0
- src/Streamly/External/ByteString.hs +12/−2
- src/Streamly/External/ByteString/Lazy.hs +7/−1
- streamly-bytestring.cabal +4/−2
Changelog.md view
@@ -1,5 +1,9 @@ # Changelog for streamly-bytestring +## 0.2.3 (Sep 2025)++* Support streamly-core-0.3.0+ ## 0.2.2 (Jul 2024) * Fix a bug that uses an unpinned array in the foreign pointer
src/Streamly/External/ByteString.hs view
@@ -89,8 +89,12 @@ {-# INLINE pinnedCreate #-} pinnedCreate :: MonadIO m => Fold m Word8 (Array Word8) -#if MIN_VERSION_streamly_core(0,2,2)+#if MIN_VERSION_streamly_core(0,3,0) ensurePinned = Array.pin+pinnedCreateOf = Array.createOf'+pinnedCreate = Array.create'+#elif MIN_VERSION_streamly_core(0,2,2)+ensurePinned = Array.pin pinnedCreateOf = Array.pinnedCreateOf pinnedCreate = Array.pinnedCreate #elif MIN_VERSION_streamly_core(0,2,0)@@ -103,6 +107,12 @@ pinnedCreate = Array.write #endif +#if MIN_VERSION_streamly_core(0,3,0)+#define CREATE_N Array.createOf+#else+#define CREATE_N Array.writeN+#endif+ {-# INLINE mutableByteArrayContents# #-} mutableByteArrayContents# :: MutableByteArray# RealWorld -> Addr# mutableByteArrayContents# marr# = byteArrayContents# (unsafeCoerce# marr#)@@ -129,7 +139,7 @@ toArray (CONSTRUCTOR(fptr, off, len)) = unsafeInlineIO $ withForeignPtr (fptr WHEN_0_10_12(`plusForeignPtr` off))- $ Unfold.fold (Array.writeN len) generator+ $ Unfold.fold (CREATE_N len) generator where
src/Streamly/External/ByteString/Lazy.hs view
@@ -37,6 +37,12 @@ import Prelude hiding (read) +#if MIN_VERSION_streamly_core(0,3,0)+#define UNFOLD_EACH Unfold.unfoldEach+#else+#define UNFOLD_EACH Unfold.many+#endif+ -- | Unfold a lazy ByteString to a stream of 'Array' 'Words'. {-# INLINE chunkReader #-} chunkReader :: Monad m => Unfold m ByteString (Array Word8)@@ -49,7 +55,7 @@ -- | Unfold a lazy ByteString to a stream of Word8 {-# INLINE reader #-} reader :: Monad m => Unfold m ByteString Word8-reader = Unfold.many Array.reader readChunks+reader = UNFOLD_EACH Array.reader readChunks -- TODO: "toChunks" should be called "read" instead -- | Convert a lazy 'ByteString' to a serial stream of 'Array' 'Word8'.
streamly-bytestring.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: streamly-bytestring-version: 0.2.2+version: 0.2.3 synopsis: Library for streamly and bytestring interoperation. description: Please see the README on GitHub at <https://github.com/psibi/streamly-bytestring#readme> category: Streamly, Stream, ByteString@@ -48,7 +48,9 @@ || == 0.11.4.* || == 0.11.5.* || == 0.12.0.*- , streamly-core >= 0.1.0 && < 0.2.3+ || == 0.12.1.*+ || == 0.12.2.*+ , streamly-core >= 0.1.0 && < 0.3.1 default-language: Haskell2010 test-suite sb-test