
Hi Joachim! Joachim Breitner wrote:
you could elaborate the documenatation “Assumes UTF-8” – I guess this only applies to the two ByteString variants, as String and Text _should_ contain unicode codepoints and no encoding. Not that someone tries to use a String where each Char corresponds to a byte in a UTF-8 encoded string and thinks he can convert it correctly.
Good point. I added a longer comment (in the repo).
I was about to suggest to merge this into the convertible package (to fight package proliferation), but found that it seems it is already there: http://hackage.haskell.org/packages/archive/convertible- text/0.4.0.2/doc/html/src/Data-Convertible-Instances-Text.html
I am aware of the Convertible class (and I really like it, btw.). But I wanted to allow for explicit string conversion. Data.Convertible.convert includes conversions with information loss (e.g. Float -> Int), while Data.String.Conversions.convertString (converts only strings and) preserves information in all cases. Cheers, Sönke