[Haskell-cafe] Question of a manual computation on Reader Monad.

2007-08-25 Thread Peter Cai
Hi all, In order to improve my understanding of monad, I am trying to do some manual computation on "Reader Monad" but I got some problem. The computation is like this: --instance Monad (Reader e) where --return a = Reader $ \e -> a --(Reader r) >>= f = Reader $ \e -> f (r e) e

[Haskell-cafe] Parsing binary data.

2007-08-18 Thread Peter Cai
Hi all, Recently I am considering doing part of my job using Haskell. My duty is writing a network server which talks to another server through a binary based private protocol. As the old version of this component is written in C, it's very natural that this protocol is base on C structure defin