[Haskell-cafe] Haskell poker server

John Meacham john at repetae.net
Tue Aug 30 21:17:12 EDT 2005


On Tue, Aug 30, 2005 at 12:35:30PM +0100, Philippa Cowderoy wrote:
> On Tue, 30 Aug 2005, Tomasz Zielonka wrote:
> 
> >On Tue, Aug 30, 2005 at 12:41:20PM +0200, Joel Reymont wrote:
> >>Erlang does this nicely, I replied to the LtU thread. I positively
> >>got the impression that nobody was parsing binary data in Haskell ;).
> >
> >I am doing this quite often, I apologize for not sharing my experience
> >and promise to improve ;-)
> >
> >BTW, if efficiency is not a primary concern, Parsec can be quite nice
> >for decoding binary messages of many protocols.
> >
> 
> I'd quite like to see some benchmarks for Parsec parsers compiled with 
> jhc, I can't help thinking that the optimisations involved would make them 
> go much faster. Not really practical right here and right now AFAIK, but 
> hey.


I'll work on it :). it does seem to behave particularly well on failable
state monads like the Maybe monad so should do well with parsec too. I
have not figured out why, I think it is due to my CPR being generalized
to work on non-CPR types as long as they are used in a CPR fashion (the
vast majority of functions in such monads are of the 'successful'
variety). This optimazation can most likely be ported to ghc easily and
it appears to be a big win in certain situations.
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list