-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I apologize for suggesting such a big change to the library, but I think this would be a huge improvement.
Lazy Text, Text, and String are all fundamentally Unicode. Keeping six different conversion functions between them is a pain, and being able to use a single function for this is really nice. string-conv fills this role really well.
ByteString and lazy ByteString don't really fit in here though. I'd like to use string-conv, but as long as there's a StringConv instance for ByteString I'm afraid to, because I risk silently overwriting data. For every use case I've ever run into I don't want ByteString -> Text, I want ByteString -> Maybe Text or some other function that admits the possibility of failure.**
** I realize this doesn't represent everybody -- I'm sure there are people dealing with more ephemeral data who like the convenience of having a ByteString -> Text function. Perhaps there could be two classes, one that includes messy conversions and one that does not?