Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread rahul
Hi Nathan, | It was purely just for demonstration. I did update the code with a few more | comments, but the enumerator package may not be the easiest thing to grok. | You might try putting up your current code and someone might be able to | recommend a better or easier approach. Thank you very m

Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread Nathan Howell
It was purely just for demonstration. I did update the code with a few more comments, but the enumerator package may not be the easiest thing to grok. You might try putting up your current code and someone might be able to recommend a better or easier approach. If the git pack headers have lengths

Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread rahul
Hi Nathan, Thank you very for the solution, since I am somewhat new to haskell, I am taking some time to digest it :). But it seems that you are using header -> streamLength to find the length of a single entry. However this info is not present in the protocol I am parsing (git server pack file

Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread Nathan Howell
On Wed, Jul 20, 2011 at 11:50 AM, rahul wrote: > Unfortunately the binary protocol itself is external, so can't use a > different > type of compression > Perhaps something like this would work: https://gist.github.com/1096039 I didn't test to make sure it works, but you could probably hack toget

Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread rahul
Hi, | > I am trying to parse a binary stream with the format for one entry | >[headers, zlib compressed content] , with multiple entries. | >I can use the Zlib library to get the content for the first entry after | >the headers, but I cannot find a way to get the offset to start parsing | >for th

Re: [Haskell-cafe] haskell zlip read position

2011-07-20 Thread Henning Thielemann
On Wed, 20 Jul 2011, rahul wrote: Hi Guys, I am trying to parse a binary stream with the format for one entry [headers, zlib compressed content] , with multiple entries. I can use the Zlib library to get the content for the first entry after the headers, but I cannot find a way to get the of

[Haskell-cafe] haskell zlip read position

2011-07-20 Thread rahul
Hi Guys, I am trying to parse a binary stream with the format for one entry [headers, zlib compressed content] , with multiple entries. I can use the Zlib library to get the content for the first entry after the headers, but I cannot find a way to get the offset to start parsing for the second