[Haskell-cafe] Parsec (Zero or One of)

Derek Elkins derek.a.elkins at gmail.com
Tue Mar 25 12:19:33 EDT 2008


On Tue, 2008-03-25 at 11:47 -0400, Albert Y. C. Lai wrote:
> Paul Keir wrote:
> > I’m having some difficulty using the Parsec library, perhaps you could 
> > help. I’ve reduced my problem as shown below. I would like the 
> > ‘only_prod’ parser to require the reserved string “only”, _optionally_ 
> > followed by an identifier. As part of ‘mytest’, this should then be 
> > followed by the reserved string “end”.
> 
> Look into option, optional, and optionMaybe.

And in particular, try doesn't do what you (Paul) think it does.  try
however is a rather important combinator of Parsec so I would behoove
you to look up it's documentation and the explanations of it in the
Parsec letter.



More information about the Haskell-Cafe mailing list