Sat Dec 2 20:00:18 EST 2017
<|> is not commutative
Below, in the definition of 'atom', the two combinators cannot be
file = endBy line (char '\n')
line = sepBy atom (char ',')
atom = quoted <|> plain
quoted = do char '"'; a <- many $ noneOf "\","; char '"'; return a
plain = many $ noneOf ",\n\""
parseCSV :: String -> Either ParseError [[String]]
parseCSV input = parse file "(unknown)" input
Says to use the 'try' combinator "which will make a parser to not
consume its input if it fails to match".
Wait... it might just be many1