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

Albert Y. C. Lai trebla at vex.net
Tue Mar 25 11:47:19 EDT 2008


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.




More information about the Haskell-Cafe mailing list