From 6b0238f2716ebbf453545f806d87bbb49db08850 Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Thu, 10 Oct 2024 19:35:12 +0530 Subject: [PATCH] Update doc and fix hlint --- core/src/Streamly/Internal/Data/Array/Type.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/Streamly/Internal/Data/Array/Type.hs b/core/src/Streamly/Internal/Data/Array/Type.hs index 80ff0c68aa..d64394c6b6 100644 --- a/core/src/Streamly/Internal/Data/Array/Type.hs +++ b/core/src/Streamly/Internal/Data/Array/Type.hs @@ -297,13 +297,12 @@ unsafeAsForeignPtr arr@Array{..} f = fptr = ForeignPtr addr# fptrContents in f fptr i -mutableByteArrayContents# :: Exts.MutableByteArray# s -> Addr# {-# INLINE mutableByteArrayContents# #-} -mutableByteArrayContents# x = +mutableByteArrayContents# :: Exts.MutableByteArray# s -> Addr# #if __GLASGOW_HASKELL__ >= 902 - Exts.mutableByteArrayContents# x +mutableByteArrayContents# = Exts.mutableByteArrayContents# #else - Exts.byteArrayContents# (Exts.unsafeCoerce# x) +mutableByteArrayContents# x = Exts.byteArrayContents# (Exts.unsafeCoerce# x) #endif -- | @unsafeFromForeignPtr fptr len@ converts the "ForeignPtr" to an "Array". @@ -1024,8 +1023,6 @@ fromPureStream x = unsafePerformIO $ fmap unsafeFreeze (MA.fromPureStream x) -- /Unsafe:/ The caller is responsible to ensure that the pointer passed is -- valid up to the given length. -- --- Note that this should be evaluated strictly to ensure that we do not hold --- the reference to the pointer in a lazy thunk. fromPtrN :: MonadIO m => Int -> Ptr Word8 -> m (Array Word8) fromPtrN n addr = fmap unsafeFreeze (MA.fromPtrN n addr)