plain :: Char -> GenParser Char st (Either String String)
plain sep = Left <$> (try plainTail <|> try (many1 (noneOf [sep])) <|> unmatched)
  where
    plainTail =
      (sep:) <$> (char sep *> many (noneOf [sep]) <* eof)
    unmatched =
      (\x -> (sep:x) ++ "\n") <$> (char sep *> many1 (noneOf [sep, '\n']) <* char '\n')
plain :: Char -> GenParser Char st (Either String String)
plain sep = Left <$> (try plainTail <|> try (many1 (noneOf [sep])) <|> unmatched)
  where
    plainTail =
      (sep:) <$> (char sep *> many (noneOf [sep]) <* eof)
    unmatched =
      (\x -> (sep:x) ++ "\n") <$> (char sep *> many1 (noneOf [sep, '\n']) <* char '\n')
plain sep = Left <$> (try plainTail <|> try (many1 (noneOf [sep])) <|> unmatched)
  where
    plainTail =
      (sep:) <$> (char sep *> many (noneOf [sep]) <* eof)
    unmatched =
      (\x -> (sep:x) ++ "\n") <$> (char sep *> many1 (noneOf [sep, '\n']) <* char '\n')