@@ -92,7 +92,7 @@ module Streamly.Internal.Data.Array.Foreign
94 , unsafeCast -- castUnsafe?
94 , unsafeCast -- castUnsafe?
95− , unsafeAsPtr -- asPtrUnsafe?
95+ , asPtrUnsafe
96 , unsafeAsCString -- asCStringUnsafe?
96 , unsafeAsCString -- asCStringUnsafe?
97 , A.unsafeFreeze -- asImmutableUnsafe?
97 , A.unsafeFreeze -- asImmutableUnsafe?
98 , A.unsafeThaw -- asMutableUnsafe?
98 , A.unsafeThaw -- asMutableUnsafe?
@@ -129,8 +129,6 @@ import Foreign.Ptr (plusPtr, castPtr)
129import Foreign.Storable (Storable(..))
129import Foreign.Storable (Storable(..))
130import Prelude hiding (length, null, last, map, (!!), read, concat)
130import Prelude hiding (length, null, last, map, (!!), read, concat)
132−import GHC.Ptr (Ptr(..))
134import Streamly.Internal.Data.Array.Foreign.Mut.Type (ReadUState(..), touch)
132import Streamly.Internal.Data.Array.Foreign.Mut.Type (ReadUState(..), touch)
135import Streamly.Internal.Data.Array.Foreign.Type
133import Streamly.Internal.Data.Array.Foreign.Type
136 (Array(..), length, asPtrUnsafe)
134 (Array(..), length, asPtrUnsafe)
@@ -555,16 +553,6 @@ cast arr =
555 then Nothing
553 then Nothing
556 else Just $ unsafeCast arr
554 else Just $ unsafeCast arr
558−-- | Use an @Array a@ as @Ptr b@.
564−unsafeAsPtr :: Array a -> (Ptr b -> IO c) -> IO c
565−unsafeAsPtr arr act = do
566− asPtrUnsafe arr $ \ptr -> act (castPtr ptr)
568-- | Convert an array of any type into a null terminated CString Ptr.
556-- | Convert an array of any type into a null terminated CString Ptr.
570-- /Unsafe/
558-- /Unsafe/