Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- packCString :: CString -> IO ShortByteString
- packCStringLen :: CStringLen -> IO ShortByteString
- useAsCString :: ShortByteString -> (CString -> IO a) -> IO a
- useAsCStringLen :: ShortByteString -> (CStringLen -> IO a) -> IO a
Documentation
packCString :: CString -> IO ShortByteString #
O(n). Construct a new ShortByteString
from a CString
. The
resulting ShortByteString
is an immutable copy of the original
CString
, and is managed on the Haskell heap. The original
CString
must be null terminated.
Since: bytestring-0.10.10.0
packCStringLen :: CStringLen -> IO ShortByteString #
O(n). Construct a new ShortByteString
from a CStringLen
. The
resulting ShortByteString
is an immutable copy of the original CStringLen
.
The ShortByteString
is a normal Haskell value and will be managed on the
Haskell heap.
Since: bytestring-0.10.10.0
useAsCString :: ShortByteString -> (CString -> IO a) -> IO a #
O(n) construction. Use a ShortByteString
with a function requiring a
null-terminated CString
. The CString
is a copy and will be freed
automatically; it must not be stored or used after the
subcomputation finishes.
Since: bytestring-0.10.10.0
useAsCStringLen :: ShortByteString -> (CStringLen -> IO a) -> IO a #
O(n) construction. Use a ShortByteString
with a function requiring a CStringLen
.
As for useAsCString
this function makes a copy of the original ShortByteString
.
It must not be stored or used after the subcomputation finishes.
Since: bytestring-0.10.10.0