[Haskell-cafe] Endian conversion

Joel Reymont joelr1 at gmail.com
Mon Oct 3 06:54:18 EDT 2005


Well, I'm looking for suggestions on how to implement this. I'll  
basically get a chunk of data from the socket that will have things  
little-endian and will need to send out a chunk that will have the  
numbers big-endian.

This is a proxy server that does binary protocol conversion. It's a  
breeze to implement in Erlang but I'm partial to Haskell and trying  
to apply it to all sorts of problems. Please, let me know if this is  
not the type of problem to apply Haskell to ;-).

     Thanks, Joel

On Oct 3, 2005, at 8:35 AM, Tomasz Zielonka wrote:

> Having htonl/ntohl as pure functions in Haskell would be a bit  
> ugly, because
> they would be defined differently on different platforms, and  
> putting them in the
> IO monad would make them barely usable.

--
http://wagerlabs.com/idealab







More information about the Haskell-Cafe mailing list