Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-07-03 Thread S. Doaitse Swierstra
If you use the uu-parsing libraries you will get a breadth-first search, instead of a non-backtrcaking depth-first search of Parsec; furthermore you do not suffer from space leaks and get your results online. In addition you get error correction, with high-quality error messages. The

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-30 Thread Stephen Tetley
Hi Erik Malcolm Wallace describes a commit combinator in the paper Partial parsing: combining choice with commitment which sounds like what you would want. It is implemented for Polyparse rather than Parsec though. From a quick scan of the paper and code, the implementation appears to be built

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-30 Thread Ivan Lazar Miljenovic
Stephen Tetley stephen.tet...@gmail.com writes: Hi Erik Malcolm Wallace describes a commit combinator in the paper Partial parsing: combining choice with commitment which sounds like what you would want. It is implemented for Polyparse rather than Parsec though. From a quick scan of the

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-30 Thread Erik de Castro Lopo
Stephen Tetley wrote: Malcolm Wallace describes a commit combinator in the paper Partial parsing: combining choice with commitment which sounds like what you would want. It is implemented for Polyparse rather than Parsec though. Yes, I can see how that might help on some kinds of data.

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-30 Thread Andrew Coppin
Ivan Lazar Miljenovic wrote: From the Polyparse homepage (http://www.cs.york.ac.uk/fp/polyparse/): , | If you are familiar with the Parsec library, then the key insight for | using PolyParse is that the two libraries' approach to backtracking | are the duals of each another. In Parsec, you

[Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Erik de Castro Lopo
Hi all, I'm reading John Hughes' paper Generalizing Monads to Arrows and found the statement regarding parser combinators: ... depend on the programmer using an additional combinator similar to Prolog's 'cut' operator do declare that a parser need never backtrack beyond a certain point.

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Antoine Latter
On Tue, Jun 29, 2010 at 10:26 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Hi all, I'm reading John Hughes' paper Generalizing Monads to Arrows and found the statement regarding parser combinators:   ... depend on the programmer using an additional combinator similar   to Prolog's

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Erik de Castro Lopo
Antoine Latter wrote: For Parsec, in the absence of the try combinator, a parser will never back-track once it consumes a portion of the input. Thanks for reminding me. If try is pushed out into the leaves of you parser, you shouldn't run in to too much trouble with excessive backtracking.