| Stability | experimental |
|---|---|
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.CStringRepresentable
Description
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 CStrings.
Minimal complete definition
Methods
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.
Instances
| CStringRepresentable String Source # |
|
| CStringRepresentable ByteString Source # |
|