Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Marcin 'Qrczak' Kowalczyk
Ketil Malde <[EMAIL PROTECTED]> writes: >> The Haskell functions accept or return Strings but interface to OS >> functions which (at least on Unix) deal with arrays of bytes (char*), >> and the encoding issues are essentially ignored. If you pass strings >> containing anything other than ISO-8859-

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Ketil Malde
Glynn Clements <[EMAIL PROTECTED]> writes: > The Haskell functions accept or return Strings but interface to OS > functions which (at least on Unix) deal with arrays of bytes (char*), > and the encoding issues are essentially ignored. If you pass strings > containing anything other than ISO-8859-1

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Glynn Clements
Ben Rudiak-Gould wrote: > >Char in Haskell represents a Unicode character. I don't know exactly > >what its size is, but it must be at least 16 bits and maybe more. > >String would then share those properties. > > > >However, usually I'm accustomed to dealing with data in 8-bit words. > >S

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Glynn Clements
John Goerzen wrote: > > > * If I use hPutStr on a string, is it guaranteed that the number of > > > 8-bit bytes written equals (length stringWritten)? > > > > Yes, if the handle is opened in binary mode. No if not. > > Thank you for the informative response. > > If a file is opened in text m

Re: [Haskell-cafe] The Nature of Char and String

2005-01-31 Thread John Meacham
On Sun, Jan 30, 2005 at 07:58:50PM -0600, John Goerzen wrote: > On Sun, Jan 30, 2005 at 07:39:59PM +, Ben Rudiak-Gould wrote: > > > * If I use hPutStr on a string, is it guaranteed that the number of > > > 8-bit bytes written equals (length stringWritten)? > > > > Yes, if the handle is opene

Re: [Haskell-cafe] The Nature of Char and String

2005-01-31 Thread David Roundy
On Sun, Jan 30, 2005 at 07:58:50PM -0600, John Goerzen wrote: > On Sun, Jan 30, 2005 at 07:39:59PM +, Ben Rudiak-Gould wrote: > > > * If I use hPutStr on a string, is it guaranteed that the number of > > > 8-bit bytes written equals (length stringWritten)? > > > > Yes, if the handle is opene

Re: [Haskell-cafe] The Nature of Char and String

2005-01-30 Thread John Goerzen
On Sun, Jan 30, 2005 at 07:39:59PM +, Ben Rudiak-Gould wrote: > > * If I use hPutStr on a string, is it guaranteed that the number of > > 8-bit bytes written equals (length stringWritten)? > > Yes, if the handle is opened in binary mode. No if not. Thank you for the informative response. I

Re: [Haskell-cafe] The Nature of Char and String

2005-01-30 Thread Ben Rudiak-Gould
John Goerzen wrote: >Char in Haskell represents a Unicode character. I don't know exactly >what its size is, but it must be at least 16 bits and maybe more. >String would then share those properties. > >However, usually I'm accustomed to dealing with data in 8-bit words. >So I have some questions: