Stability | experimental |
---|---|
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides the type class (and a few implementations) for values that
can be efficiently converted to/from CString
. Instances for String
and
strict ByteString
are provided, and the use of ByteString
is
recommended if performance is a concern.
- class CStringRepresentable a where
Documentation
class CStringRepresentable a where Source #
Represents values that can be efficiently converted to and from CString
s.
toCString :: a -> (CString -> IO b) -> IO b Source #
Perform a function on the CString
representation of the value.
fromCString :: CString -> IO a Source #
Convert CString
to a value of the type. The ownership is not transferred.
CStringRepresentable String Source # |
|
CStringRepresentable ByteString Source # |
|