Thu Jul 6 08:39:30 PDT 2006 [EMAIL PROTECTED]
* New, lazier variations of the parser combinators
The other sets of parser combinators return either a value or an error
indicator. This means that a /whole item/ must be consumed from the
input before it is returned to the rest of the program, because any
errors must bubble up to the top-level of the parser.
These new lazier combinators allow partial values to be returned
immediately. That is, the returned value might contain bottom, if there
is an error later in the parse, but you can start processing the value
anyway. If you never use the rest of the input, no error will be
reported. But if a parse error is discovered later, an exception is
thrown (to the nearest enclosing I/O monad) - however your partial
processing of the value might still have side-effected the world, e.g.
if you output something to the screen.
The main benefit is that you can now process streams of incoming data as
they arrive, without waiting for the whole thing. For large input,
memory usage can be much lower, and speed significantly faster.
A ./src/Text/ParserCombinators/PolyLazy.hs
A ./src/Text/ParserCombinators/PolyStateLazy.hs
_______________________________________________
Cvs-libraries mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-libraries