[Haskell-cafe] ANNOUNCE: string-conversions-0.1
Michael Snoyman
michael at snoyman.com
Fri Mar 9 12:44:23 CET 2012
On Fri, Mar 9, 2012 at 1:40 PM, Joachim Breitner
<mail at joachim-breitner.de> wrote:
> Hi Sönke,
>
> Am Freitag, den 09.03.2012, 11:17 +0100 schrieb Sönke Hahn:
>> Any comments welcome.
>
> 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.
>
> 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
>
> Greetings,
> Joachim
>
> --
> Joachim "nomeata" Breitner
> mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C
> xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
I'm the author of convertible-text, and I consider it deprecated (it's
marked as such in the synopsis).
As far as string-conversions, I'm a little concerned that it's using
decodeUtf8, which can throw exceptions from pure code for invalid UTF8
sequences. I would prefer decodeUtf8With lenientDecode. Actually, my
*real* preference would be that a lenient decode was the default so
that we aren't exposing a partial function as the default way to
decode bytes.
Michael
More information about the Haskell-Cafe
mailing list