[Haskell-cafe] Re: Parsec: Parenthesized expressions and more!
Christian.Maeder at dfki.de
Tue Aug 14 05:00:31 EDT 2007
> I was trying out some parsing with parsec. I tried:
> Accepting proper parenthesized expressions, this was the
> parens :: Parser ()
> parens = do
> char '('
> char ')'
> <|> return ()
I would indent "<|> return ()" a bit less:
<|> return ()
Use "parens >> eof" to test for full string consumption.
More information about the Haskell-Cafe