
28 Jul
2004
28 Jul
'04
1:35 p.m.
W liście z śro, 28-07-2004, godz. 18:59 +0200, Peter Simons napisał:
IMHO, Parsec is too complicated for something that simply.
It is, but I don't have anything else.
Stick to the example of implementing a 'lines' that uses \r\n instead of \n, if you will: I don't want any monads, I don't want error messages, I don't need any recursive descent parser.
let splitLines str = result where Right result = parse (anyChar `manyTill` sep `manyTill` eof) "" str sep = (char '\n' >> return ()) <|> (try (string "\r\n") >> return ()) <|> eof BTW, IMHO the 'string' function should use 'try' automatically. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/