
19 Jul
2012
19 Jul
'12
9:34 a.m.
On Thu, Jul 19, 2012 at 06:45:05PM +0530, Sai Hemanth K wrote:
gettext = (many1 $ noneOf "><") >>= (return . Body)
You can simplify this to: import Control.Applicative hiding ((<|>)) gettext = Body <$> many1 (noneOf "><") And some of your other parsers can be simplified as well: innerXML = xml <|> gettext openTag :: Parser String openTag = char '<' *> many (noneOf ">") <* char '>' endTag :: String -> Parser String endTag str = string "" *> string str <* char '>'