[Haskell-cafe] Re: Writing binary files?

Udo Stenzel u.stenzel at web.de
Thu Sep 16 05:28:54 EDT 2004


Glynn Clements <glynn.clements at virgin.net> schrieb am 16.09.04 10:46:58:
> Gabriel Ebner wrote:
> > One more reason to fix the I/O functions to handle encodings and have
> > a seperate/underlying binary I/O API.
> 
> The problem is that we also need to fix them to handle *no encoding*.

What are you proposing here?  Making the breakage even worse by specifying
a text based api that uses "no encoding"?  

Having a seperate byte based api is far better.  If you don't know the encoding, 
all you have is bytes, no text.

> Also, binary data and text aren't disjoint. Everything is binary; some
> of it is *also* text.

No, it isn't.  Everything is binary (read: we need a byte based io library), after
decoding and only after decoding it becomes text (read: we need explicit support
for decoding and probably a convenience layer that looks like the old io library).

> >  String's are a list of unicode characters, [Word8] is a
> > list of bytes.
> 
> And what comes out of (and goes into) most core library functions is
> the latter.

So System.Directory needs to be specified in terms of bytes, too.  Looks like
a clean solution to me.


Regards,

Udo.

________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193



More information about the Haskell-Cafe mailing list