Sorry took so long to get back... Thank you for the response. Been really busy lately :-)
You could just define data type and Binary instance for 9P messages. SomethingOn Friday 15 May 2009 06:52:29 David Leimbach wrote:
> I actually need little endian encoding... wondering if anyone else hit this
> with Data.Binary. (because I'm working with Bell Lab's 9P protocol which
> does encode things on the network in little-endian order).
> Anyone got some "tricks" for this?
>
> Dave
like this:
P9Message = Tversion { tag :: Word16, msize :: Word32, version :: String }
| ...
instance Binary P9Message where
put (Tverstion t m v) = putWord16le t >> putWord32le m >> put v
-- and so on...
get = do
length <- getWord32le
id <- getWord16le
case is of
p9TMessage -> do ...
There are a lot of boilerplate code thought...
BTW could you say what do you want to do with 9P? I tried to play with it
using libixp library but without any success. It was mainly to understand how
does it works and how can it be used.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe