[Haskell-cafe] Data.Binary.GetT or ... ?

Juraj Hercek juhe_haskell at hck.sk
Sat Mar 13 05:06:12 EST 2010


Hello,

I'm thinking about using Data.Binary to parse binary stream of data. 
Binary data stream consists of messages which can have one or more 
(sometimes couple of hundreds) sub-messages.  The stream is spitting out 
data slowly.

I would like to parse this data with Data.Binary.Get monad, but I would 
like to send sub-messages to a STM channel while parsing, so "observers" 
could handle them during parsing process.

I believe I could achieve this with a Data.Binary.GetT transformer, but 
I'm not aware it exists.

Implementing GetT would take me a huge amount of time (I'm not that good 
haskeller). Splitting processing to message level and sub-message level 
and handling them by two separate "get"s in IO monad is a possibility, 
but not really appealing one (at least to me).

Is there another (preferably cheap) way of doing what I want?

Thanks,
Juraj


More information about the Haskell-Cafe mailing list