Skip to content

GroupEntry/UserEntry uses String (even in ByteString variants) #237

@hasufell

Description

@hasufell

#63 (comment)

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:

  1. use ByteString based record for both APIs
  2. keep String based records
  3. provide two different types
  4. parametrize the type with the String type
  5. 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

I think all except 2 are breaking changes, even 5. I'm leaning towards 5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions