[darcs-users] New IO System in GHC (no more utf8-string?)

Ganesh Sittampalam ganesh at earth.li
Mon Dec 14 21:41:00 UTC 2009


On Wed, 9 Sep 2009, Ganesh Sittampalam wrote:

> On Wed, 9 Sep 2009, Eric Kow wrote:
>
>> On Tue, Sep 08, 2009 at 20:12:25 +0100, Ganesh Sittampalam wrote:
>
>>> That's correct (well, once we've dropped support for 6.10, which I guess
>>> is a couple of years off). One thing we need to check for is that we're
>>> not doing openFile rather than openBinaryFile on a binary file and then
>>> expecting to get back a list of Chars that are actually Word8 - because
>>> that assumption will suddenly break - but it's unlikely we are doing that
>>> given that it would also break line-ending characters on Windows if we
>>> did.
>> 
>> Would we not need to be doing openBinaryFile on all files text and
>> binary alike?
>> 
>> [I'm assuming we need to retain the behaviour of being completely
>>  encoding agnostic wrt to file contents except for expecting
>>  newlines]
>
> Ugh, yes. How annoying, since we'll now manually have to handle the 
> newline issue.

I belatedly realised after my GHC 6.12 patches were accepted that we 
didn't do anything about this problem. But some experiments and a cursory 
glance over the source code make me think that we always deal with files 
in binary mode so there are no issues with encodings. [All we do wrt 
newlines is to split on '\n', so nothing changes here either AFAIK.]

Ganesh


More information about the darcs-users mailing list