
On Wed, Sep 8, 2010 at 2:56 AM, Duncan Coutts
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.