[Haskell-cafe] Re: Lazy Parsing

Guenther Schmidt gue.schmidt at web.de
Sun May 31 07:45:15 EDT 2009

Dear Doaitse,

thank you very much for your help.

> I am curious to know what made you go wrong with the tutorial, and 
> caused that you could not find the solution below?
Well let's first agree that I'm not very bright. I hate to admit it, but 
it's a simple fact ;-).

Second let's agree that the uu-parsinglib is a *very* sophisticated 
beast, I have not seen anything else like it out there, my sincere 
congratulations for it. Thirdly the tutorial is also a very 
sophisticated beast, and forthly, well just see point 1 :-).

And I just figured out why I was unable to write even that simple parser.

The code you sent me works just fine, I copied and pasted it, no problems.

But, as soon as I comment out the "main" function the type checker 
complains, because now the ghci's type checker can no longer infer the 
types of pDate or pDot. And this is exactly what happened. I kept 
getting error messages from ghci, eventhough I had defined my parsers 
possible correctly, but, *minus* the type signatures *and* minus any 
main function that called it.

In hindsight I realize that this is a trap I have walked into many times 
before, I guess I still have not acquired a Haskellers intuition.

I promise to do better next time :)


More information about the Haskell-Cafe mailing list