[Haskell-cafe] Encoding the encoding type of a string into its type

Christopher Done chrisdone at googlemail.com
Fri Jun 11 10:17:25 EDT 2010


There are a lot of issues with string encoding type mismatches.
Especially "automatic" conversions. This mailing list gets enough
posts about encoding confusions.

Would it make sense to make the string depend on its encoding type?

E.g. a String UTF16 cannot be used with putStrLn :: String UTF8, it
has to be used with putStrLn :: String UTF16. Provided the fundamental
functions that read and write strings are type safe, there'll be no
mix-ups?

I'll think about this more later. Just putting the question out there
so that I remember when I get home.


More information about the Haskell-Cafe mailing list