[Haskell-cafe] A very nontrivial parser

Miguel Mitrofanov miguelimo38 at yandex.ru
Thu Jul 5 14:28:05 EDT 2007


AC> For the Nth time... The amount of data processed by parser1 needs
AC> to depend on the amount of data processed by parser2. (The amount
AC> of data output by each parser is very nontrivially related to the
AC> amount of data consumed.)

What about lazyness? Let parser1 process ALL the data and return
chunks of output paired with the amount of data read; then, parser2
have to return it's result paired with the amount of data read, known
from parser1, allowing parser3 to know where to start. It doesn't
matter that parser1 wouldn't recognize the rest of data, since it
wouldn't be fed with it due to lazyness.



More information about the Haskell-Cafe mailing list