Haskell Platform Proposal: add the 'text' library
Bryan O'Sullivan
bos at serpentine.com
Wed Sep 8 10:45:29 EDT 2010
On Wed, Sep 8, 2010 at 2:56 AM, Duncan Coutts
<duncan.coutts at googlemail.com>wrote:
> > I'm afraid not. The TextEncoding type ties encoding and decoding
> together,
> > when in pure code you need just one or the other.
>
> I have to say I don't understand this.
I think I might have been paying insufficiently close attention when I wrote
that. I recalled the type specifying both an encoder and a decoder (which it
does), and erroneously extended that in my memory to the smart constructor
requiring a specification of each (which it doesn't).
> Are you saying there are encodings where
it only makes sense to implement one direction?
No, the point I thought I was trying to make was that what you need out of
an encoding is almost always asymmetric. In network apps, for instance, I
need only decoders in one location in my code, and encoders either somewhere
else entirely or not at all. But that's moot.
But regardless, TextEncoding as it stands isn't quite up to snuff, and I
don't want to redo that.
and internally redefine:
Right.
> decodeUtf8 = decode utf8 -- or is it utf8_bom ?
I don't think Data.Text supports that particular encoding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20100908/1e324b27/attachment.html
More information about the Libraries
mailing list