Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- withCString :: MonadUnliftIO m => Text -> (CString -> m a) -> m a
- withCStringOrNull :: Maybe Text -> (CString -> IO a) -> IO a
- withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
- withCStringEnd :: MonadUnliftIO m => Text -> (CString -> CString -> m a) -> m a
- peekCString :: CString -> IO Text
- data Text
- pack :: String -> Text
- unpack :: Text -> String
Documentation
withCString :: MonadUnliftIO m => Text -> (CString -> m a) -> m a Source #
withCStringLen :: Text -> (CStringLen -> IO a) -> IO a #
Marshal a Text
into a C string encoded as UTF-8 in temporary
storage, with explicit length information. The encoded string may
contain NUL bytes, and is not followed by a trailing NUL byte.
The temporary storage is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this function returns.
Since: text-1.0.0.0
withCStringEnd :: MonadUnliftIO m => Text -> (CString -> CString -> m a) -> m a Source #
A space efficient, packed, unboxed Unicode text type.