[Haskell-cafe] Parsec memory behavior

Jeremy Shaw jeremy.shaw at linspireinc.com
Wed May 17 18:05:49 EDT 2006


At Wed, 17 May 2006 11:36:00 -0700,
Juan Carlos Arevalo Baeza wrote:

>    Is there any known alternative that doesn't exhibit this behavior? It 
> would have to somehow return errors inline or on a "side channel". I'll 
> be toying with this sort of thing for a while.

You might try reading,

Polish Parsers, Step By Step
by R. John M. Hughes and S. Doaise Swierstra

http://www.cs.uu.nl/docs/vakken/afp/Literature/p224-swierstra.pdf

From the abstract:
---
We present the derivation of a space efficient parser combin-
ator library: the constructed parsers do not keep unneces-
sary references to the input, produce online results and effi-
ciently handle ambiguous grammars. The underlying tech-
niques can be applied in many contexts where traditionally
backtracking is used.
---

By 'online' they mean able to starting producing results before the
whole thing is parsed.

j.


More information about the Haskell-Cafe mailing list