[Haskell-cafe] Re: ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-23 Thread Simon Marlow
Chris Kuklewicz wrote: I am cross-posting this message to several lists. I had learned the trick before the documentation was updated. It seems I have used a very unreliable trick. And the use castToSTUArray suggested alternative is a really poor one since I am not using arrays at all.

[Haskell-cafe] Re: ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-22 Thread Chris Kuklewicz
I am cross-posting this message to several lists. I had learned the trick before the documentation was updated. It seems I have used a very unreliable trick. And the use castToSTUArray suggested alternative is a really poor one since I am not using arrays at all. Who can suggest a way to

Re: [Haskell-cafe] Re: ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-22 Thread Yitzchak Gale
Chris Kuklewicz wrote: Who can suggest a way to cast from Float to Word32 and Double to Word64 using ghc? The actual task is that I need to write out the Float as a little endian sequence of four bytes and also be able to read it back in. The writing and reading are done in Put and Get

Re: [Haskell-cafe] Re: ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-22 Thread Bulat Ziganshin
Hello Chris, Monday, September 22, 2008, 2:48:16 PM, you wrote: used a very unreliable trick. And the use castToSTUArray suggested alternative is a really poor one since I am not using arrays at all. castToSTUArray does the same as your code, only in ST monad so you can skip unsafePerformIO