dot:
> On Sun, 19 Aug 2007, Peter Cai wrote:
> >
> > My duty is writing a network server which talks to another server through a
> > binary based private protocol.
> 
> Haskell needs something like Erlang's bit syntax.
> 
> http://erlang.org/doc/reference_manual/expressions.html#6.16
> http://erlang.org/doc/programming_examples/bit_syntax.html#4
> The IP header example in the latter is a brilliant real-world example.
> 
> It has recently been upgraded to support arbitrary bit streams.
> See http://www.it.uu.se/research/group/hipe/papers/padl07.pdf
> 

Yes, we've looked at this in the context of Data.Binary. Rather than
extending the core syntax, on option is to use Template Haskell,

    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/BitSyntax-0.3

Another is to just use monad and pattern guards, which give quite
reasonable syntax.

-- Don
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to