
15 Apr
2011
15 Apr
'11
8:01 p.m.
On Saturday 16 April 2011 01:44:32, Rob Nikander wrote:
Hi,
Is there a way to return the remaining input, so that parsec can be used to parse one piece at a time. So something like:
chunk = many (noneOf ",:")
chunk = do first <- many (noneOf ",:") rest <- getInput -- maybe `setInput ""' here return (first, rest)
parse chunk "abc,123:xyz"
But that looks like you're going to iterate, so maybe sepBy (many $ noneOf ",:") (oneOf ",:") should be looked at.
Would return ("abc", ",123:last") or similar?
thanks, Rob