Parsing single qoute char in a single-quoted string in parsec
问题 I've got a silly situation in my parsec parsers that I would like your help on. I need to parse a sequence of strongs / chars that are separated by | characters. So, we could have a|b|'c'|'abcd' which should be turned into [a,b,c,abcd] Space is not allowed, unless inside of a ' ' string. Now, in my naïve attempt, I got the situation now where I can parse strings like a'a|'bb' to [a'a,bb] but not aa|'b'b' to [aa,b'b]. singleQuotedChar :: Parser Char singleQuotedChar = noneOf "'" <|> try