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

Paul Keir pkeir at dcs.gla.ac.uk
Tue Mar 25 12:43:08 EDT 2008


Thanks. I can't find optionMaybe in my version 2.1 of Parsec, but in any case, defining my only_prod as

only_prod = do { reserved "only"; option [] identifier }

or

only_prod = do { reserved "only"; identifier <|> return [] }

gives the same error responses as before. I will anyway look closer at option.

You're right that I don't understand try, but it's not for lack of trying. My examples' use of try though was just a stab at a readable failure. Maybe I should refactor my example.

Paul


More information about the Haskell-Cafe mailing list