On 2005-09-15, Adam Turoff <[EMAIL PROTECTED]> wrote:
> On 9/15/05, John Goerzen <[EMAIL PROTECTED]> wrote:
>> So, to make that approach work, I would really need to do a lot of work
>> outside of Parsec -- the stuff that I really want to use Parsec for, I
>> think.
>
> Well, you do have a state monad to work with.  Why not just stuff
> the number 305 into your state, keep reading until you've read 305 bytes 
> (decrementing the count as you read), and return the 305-byte string 
> as your result for this parser?  When you resume,  you should 
> be ready to parse the next very token after the 305-byte string.

It's unclear to me exactly how to mix the IO monad with Parsec.  It
doesn't really seem to be doable.

Not to mention that if hGetContents is used, the Handle has to be put
into non-buffering mode, which means one syscall per character read.
Terribly slow.


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

Reply via email to