iridcode at gmail.com
Wed Mar 30 13:12:53 CEST 2011
2011/3/30 Simon Marlow <marlowsd at gmail.com>
> On 30/03/2011 10:58, Simon Meier wrote:
> In the 'bytestring' library, String handling based on this encoding is
>> provided by the Data.ByteString.Char8 module and its lazy cousin.
>> Therefore, I'd suggest to name this non-standard (or is there a
>> standard?) encoding
>> char8 :: TextEncoding
>> Apart from historical reasons, I also prefer this name as it conveys
>> more information about its semantics.
> There's a clash here as we already use the term "binary" elsewhere in the
> System.IO API: openBinaryFile, hSetBinary. So, it's not clear to me that
> being consistent with Data.ByteString is better than being consistent with
> System.IO. On the other hand, "char8" is a better name than "binary". I
> don't feel strongly either way here.
Ah, I didn't see that. However, if I recall correctly, the long-term plan is
to introduce a separate type for binary files. I would expect that the
caller has to explicitly specify an encoding when writing a String to such a
binary file. However, there still might be uses of text file handles with a
'char8' encoding. Hence, in the long-term, we can actually avoid confusion
by not choosing 'binary' as the name of this encoding.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries