Mark Carroll | 1 Jan 01:21 2004

Parsec question

I tried posting this before but, from my point of view, it vanished. My
apologies if it's a duplicate.

In http://www.cs.uu.nl/~daan/download/parsec/parsec.html we read,

> testOr2 =   try (string "(a)")
>         <|> string "(b)"
>
> or an even better version:
>
> testOr3 =   do{ try (string "(a"); char ')'; return "(a)" }
>         <|> string "(b)"

Why is the latter better?

(BTW, I like Parsec. Thanks, Daan. (-:)

-- Mark

Gmane