Skip to content

Commit

Permalink
MutableByteArray -> MutByteArray for streamly-0.10.*
Browse files Browse the repository at this point in the history
  • Loading branch information
adamConnerSax authored and adithyaov committed Dec 1, 2023
1 parent 94920f7 commit 2a59c90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Streamly/External/ByteString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import qualified Streamly.Internal.Data.Unfold as Unfold (fold, mkUnfoldrM)

#if MIN_VERSION_streamly_core(0,2,0)
import Streamly.Internal.Data.Array (Array(..))
import Streamly.Internal.Data.Unbox (MutableByteArray(..))
import qualified Streamly.Internal.Data.Unbox as Unboxed (nil)
import Streamly.Internal.Data.MutByteArray (MutByteArray(..))

Check failure on line 47 in src/Streamly/External/ByteString.hs

View workflow job for this annotation

GitHub Actions / 9.6.2

Could not find module ‘Streamly.Internal.Data.MutByteArray’
import qualified Streamly.Internal.Data.MutByteArray as MutBA (nil)

Check failure on line 48 in src/Streamly/External/ByteString.hs

View workflow job for this annotation

GitHub Actions / 9.6.2

Could not find module ‘Streamly.Internal.Data.MutByteArray’
import qualified Streamly.Internal.Data.Stream as StreamD (Step(Yield))
#else
import Streamly.Internal.Data.Array.Type (Array(..))
Expand All @@ -62,8 +62,8 @@ mutableByteArrayContents# marr# = byteArrayContents# (unsafeCoerce# marr#)

-- | Helper function that creates a ForeignPtr
{-# INLINE makeForeignPtr #-}
makeForeignPtr :: MutableByteArray -> Int -> ForeignPtr a
makeForeignPtr (MutableByteArray marr#) (I# off#) =
makeForeignPtr :: MutByteArray -> Int -> ForeignPtr a

Check failure on line 65 in src/Streamly/External/ByteString.hs

View workflow job for this annotation

GitHub Actions / 8.10.7+stack

Not in scope: type constructor or class ‘MutByteArray’
makeForeignPtr (MutByteArray marr#) (I# off#) =

Check failure on line 66 in src/Streamly/External/ByteString.hs

View workflow job for this annotation

GitHub Actions / 8.10.7+stack

Not in scope: data constructor ‘MutByteArray’
ForeignPtr
(mutableByteArrayContents# marr# `plusAddr#` off#)
(PlainPtr marr#)
Expand All @@ -74,10 +74,10 @@ makeForeignPtr (MutableByteArray marr#) (I# off#) =
{-# INLINE toArray #-}
toArray :: ByteString -> Array Word8
toArray (BS (ForeignPtr addr# _) _)
| Ptr addr# == nullPtr = Array Unboxed.nil 0 0
| Ptr addr# == nullPtr = Array MutBA.nil 0 0

Check failure on line 77 in src/Streamly/External/ByteString.hs

View workflow job for this annotation

GitHub Actions / 8.10.7+stack

Not in scope: ‘MutBA.nil’
toArray (BS (ForeignPtr addr# (PlainPtr marr#)) len) =
let off = I# (addr# `minusAddr#` mutableByteArrayContents# marr#)
in Array (MutableByteArray marr#) off (off + len)
in Array (MutByteArray marr#) off (off + len)
toArray (BS fptr len) =
unsafeInlineIO
$ withForeignPtr fptr $ Unfold.fold (Array.writeN len) generator
Expand Down

0 comments on commit 2a59c90

Please sign in to comment.