Re: [Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-28 Thread S. Doaitse Swierstra
On 27 apr 2010, at 22:12, Jason Dusek wrote: So UU parsers can construct input? The perform an editing action on the input so it becomes a sentence of the language recognised. The presence of an empty list in the 2nd slot of the tuple is the only indicator of errors? The parser wants

[Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-27 Thread Tom Hawkins
I had been using Parsec to parse VCD files, but needed to lazily parse streaming data. After stumbling on this thread below, I switch to polyparse. What a great library! I was able to migrate from a strict to a semi-lazy parser and many of my parse reductions didn't even need to change. Thanks

Re: [Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-27 Thread S. Doaitse Swierstra
How about: import Text.ParserCombinators.UU.Parsing import Text.ParserCombinators.UU.Examples pDate :: Pars (Int,Int,Int) pDate = (,,) $ pNatural * pDot * pNatural * pDot * pNatural where pDot = pSym '.' and then: *Main test pDate 3.4.5 Loading package syb-0.1.0.2 ... linking ...

Re: [Haskell-cafe] Lazy Parsing (ANN: vcd-0.1.4)

2010-04-27 Thread Jason Dusek
So UU parsers can construct input? The presence of an empty list in the 2nd slot of the tuple is the only indicator of errors? For parsing datatypes without a sensible default value, what happens? -- Jason Dusek ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Lazy Parsing

2009-05-29 Thread S. Doaitse Swierstra
Lazy parsing has been the default for the last ten years in uulib, and is now available in the simple uu-parsinglib (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/uu-parsinglib ). The whole design of the latter in described in a technical report to which references are given on

Re: [Haskell-cafe] Lazy Parsing

2009-05-29 Thread S. Doaitse Swierstra
In the uu-parsinglib we actually have two versions of parsers: lazy ones and strict ones, which have different types. So by giving a type annotation you can select the one you want. Notice that in the left- hand side of a monadic construct it does not make sense to use a lazy parser, since

Re: [Haskell-cafe] Lazy Parsing

2009-05-29 Thread Guenther Schmidt
Dear Doaitse, In the days since my original post I had already come to favor the uu-parsing package. I have printed the report and read it every day to figure out how to use it. I cannot follow everything yet, and also hope that won't be necessary in order to use it. :-) My progress is a bit

Re: [Haskell-cafe] Lazy Parsing

2009-05-28 Thread Malcolm Wallace
Henning Thielemann schlepp...@henning-thielemann.de wrote: I don't think that it is in general possible to use the same parser for lazy and strict parsing, just because of the handling of parser failure. Polyparse demonstrates that you can mix-and-match lazy parsers with strict parsers in the

Re: [Haskell-cafe] Lazy Parsing

2009-05-27 Thread Henning Thielemann
GüŸnther Schmidt schrieb: Hi all, is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before I do switch to polyparse I rather make sure I actually have to.

Re: [Haskell-cafe] Lazy Parsing

2009-05-27 Thread Henning Thielemann
On Wed, 27 May 2009, Gü?nther Schmidt wrote: is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before I do switch to polyparse I rather make sure I actually

[Haskell-cafe] Lazy Parsing

2009-05-26 Thread GüŸnther Schmidt
Hi all, is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before I do switch to polyparse I rather make sure I actually have to. The files it has to parse is