[Haskell-cafe] Need help with learning Parsec

Christian Maeder Christian.Maeder at dfki.de
Thu Jul 19 15:26:26 CEST 2012


Am 19.07.2012 15:14, schrieb Christian Maeder:
> Am 19.07.2012 14:53, schrieb C K Kashyap:
>> innerXML = do
>>           x <- (try xml <|> gettext)
>>           return x
>
> Omit "try" (and return).
> xml always starts with "<" whereas gettext never does.

I was wrong, you do not want to swallow an endTag as openTag.

openTag should start with:
	try $ char '<' >> notFollowedBy (char '/')

and endTag should start with:
         try $ string "</"

C.

>
> C.
>
>




More information about the Haskell-Cafe mailing list