Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
accursedUnutterablePerformIO :: IO a -> abytestring Data.ByteString.Internal This "function" has a superficial similarity to unsafePerformIO but it is in fact a malevolent agent of chaos. It unpicks the seams of reality (and the IO monad) so that the normal rules no longer apply. It lulls you into thinking it is reasonable, but when you are not looking it stabs you in the back and aliases all of your mutable buffers. The carcass of many a seasoned Haskell programmer lie strewn at its feet. Witness the trail of destruction:
- https://github.com/haskell/bytestring/commit/71c4b438c675aa360c79d79acc9a491e7bbc26e7
- https://github.com/haskell/bytestring/commit/210c656390ae617d9ee3b8bcff5c88dd17cef8da
- https://github.com/haskell/aeson/commit/720b857e2e0acf2edc4f5512f2b217a89449a89d
- https://ghc.haskell.org/trac/ghc/ticket/3486
- https://ghc.haskell.org/trac/ghc/ticket/3487
- https://ghc.haskell.org/trac/ghc/ticket/7270
- https://gitlab.haskell.org/ghc/ghc/-/issues/22204
deferForeignPtrAvailability :: ForeignPtr a -> IO (ForeignPtr a)bytestring Data.ByteString.Internal Most operations on a ByteString need to read from the buffer given by its ForeignPtr Word8 field. But since most operations on ByteString are (nominally) pure, their implementations cannot see the IO state thread that was used to initialize the contents of that buffer. This means that under some circumstances, these buffer-reads may be executed before the writes used to initialize the buffer are executed, with unpredictable results. deferForeignPtrAvailability exists to help solve this problem. At runtime, a call deferForeignPtrAvailability x is equivalent to pure $! x, but the former is more opaque to the simplifier, so that reads from the pointer in its result cannot be executed until the deferForeignPtrAvailability x call is complete. The opaque bits evaporate during CorePrep, so using deferForeignPtrAvailability incurs no direct overhead.
fromForeignPtr :: ForeignPtr Word8 -> Int -> Int -> ByteStringbytestring Data.ByteString.Internal O(1) Build a ByteString from a ForeignPtr. If you do not need the offset parameter then you should be using unsafePackCStringLen or unsafePackCStringFinalizer instead.
fromForeignPtr0 :: ForeignPtr Word8 -> Int -> ByteStringbytestring Data.ByteString.Internal No documentation available.
nullForeignPtr :: ForeignPtr Word8bytestring Data.ByteString.Internal The 0 pointer. Used to indicate the empty Bytestring.
plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr bbytestring Data.ByteString.Internal No documentation available.
toForeignPtr :: ByteString -> (ForeignPtr Word8, Int, Int)bytestring Data.ByteString.Internal O(1) Deconstruct a ForeignPtr from a ByteString
toForeignPtr0 :: ByteString -> (ForeignPtr Word8, Int)bytestring Data.ByteString.Internal O(1) Deconstruct a ForeignPtr from a ByteString
unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO bbytestring Data.ByteString.Internal No documentation available.
asForeignPtr :: Text -> IO (ForeignPtr Word8, I8)text Data.Text.Foreign O(n) Make a mutable copy of a Text.