-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Description
String has encoding issues. These things should be NUL terminated byte arrays that we get from the C API. The problem is how to unify across String and ByteString modules, since these are types, not just functions:
- use ByteString based record for both APIs
- keep String based records
- provide two different types
- parametrize the type with the String type
- use ByteString, but don't expose the constructor/records and instead provide "getters"
- these can do the
ByteString -> String
conversion in the String API - the conversion currently uses
castCCharToChar :: CChar -> Char ; castCCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))
, which assumes Latin-1 - also possible to provide pattern synonyms
- these can do the
I think all except 2 are breaking changes, even 5. I'm leaning towards 5