cppfilt-0.1.0.0: Bindings for C++ demangling routines

Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

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.

Synopsis

Documentation

class CStringRepresentable a where Source #

Represents values that can be efficiently converted to and from CStrings.

Minimal complete definition

toCString, fromCString

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 #

Strings can be represented as CStrings (albeit conversions are inefficient).

CStringRepresentable ByteString Source #

ByteStrings can be represented as CStrings.