Re: [Haskell-cafe] Endian conversion

2005-10-04 Thread John Meacham
On Mon, Oct 03, 2005 at 09:33:11PM +0200, Udo Stenzel wrote: > Joel Reymont wrote: > > Are there any endian conversion routines for Haskell? I'm looking to > > build binary packets on top of NewBinary.Binary but my data is coming > > in little-endian whereas I'll need to send it out big endian.

Re: [Haskell-cafe] Converting [Word8] to String

2005-10-04 Thread Glynn Clements
Tomasz Zielonka wrote: > > How do I convert a list of bytes to a string? > > I assume you don't care about Unicode: That should have said "I assume that the data is encoded using ISO-8859-1 (or a subset thereof, e.g. US-ASCII)". > map (Char.chr . fromIntegral) > > or > > map (toEnum . fromEn

[Haskell-cafe] IRC for spreading information

2005-10-04 Thread John Goerzen
I've got a bit of a concern to raise regarding reliance on IRC for spreading information important to the community. As I was preparing this week's HWN, I made the comment on #haskell that it's been a quiet week. Several people that were at ICFP and the workshops disagreed, saying there had been

Re: [Haskell-cafe] Converting [Word8] to String

2005-10-04 Thread Joel Reymont
I know it does since I control the protocol :-). On Oct 4, 2005, at 11:04 AM, Wolfgang Jeltsch wrote: You seem to think that one byte has to correspond to one character but this isn't the case in certain character encodings. In addition, even if one byte corresponds to one character, a byt

Re: [Haskell-cafe] Short Cut / Rewrite Rules Problem in GHC

2005-10-04 Thread Wolfgang Jeltsch
Am Dienstag, 4. Oktober 2005 04:15 schrieb Chris: > [...] > When I don't have them enabled it gives this error: > > chris$ ghc --make Main.hs > Chasing modules from: Main.hs > Compiling Main ( Main.hs, Main.o ) > > Main.hs:8:18: parse error on input `.' I suppose, this is beca

Re: [Haskell-cafe] Converting [Word8] to String

2005-10-04 Thread Wolfgang Jeltsch
Am Sonntag, 2. Oktober 2005 12:52 schrieb Joel Reymont: > Folks, > > How do I convert a list of bytes to a string? > > Cale has suggested a neat way of parsing binary packets in this thread: > > http://www.mail-archive.com/haskell-cafe@haskell.org/msg09413.html > > and I'm trying to create a packet