
It's not that it has no effect. If you have two parsers that have no common
initial productions then wrapping the first parser would have no effect.
That is the case here.
Just think of try as wrapping the stream / parser in a transaction. On
failure it rolls back.
On 14 Oct 2011 10:32, "Obscaenvs"
In http://book.realworldhaskell.org/read/using-parsec.html , under the heading "Extended example: Full CSV Parser", there is in the function quotedChar an occurrence of the operator <|> with a try after it (i.e. to the right) . Now, in this chapter it says a little before that "try only has an effect if it is on the left of a <|>.". So in this particular case, try has no effect, or?
The offending code: <code>quotedChar = noneOf "\"" <|> try (string "\"\""
return '"')</code>
Help much appreciated, if not absolutely vital :)
/Fredrik
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners