{"action":"reopened","issue":{"url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/35","labels_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/35/comments","events_url":"https://api.github.com/repos/mrkkrp/megaparsec/issues/35/events","html_url":"https://github.com/mrkkrp/megaparsec/issues/35","id":107563092,"number":35,"title":"A possible regression regarding error reporting","user":{"login":"neongreen","id":1523306,"avatar_url":"https://avatars.githubusercontent.com/u/1523306?v=3","gravatar_id":"","url":"https://api.github.com/users/neongreen","html_url":"https://github.com/neongreen","followers_url":"https://api.github.com/users/neongreen/followers","following_url":"https://api.github.com/users/neongreen/following{/other_user}","gists_url":"https://api.github.com/users/neongreen/gists{/gist_id}","starred_url":"https://api.github.com/users/neongreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neongreen/subscriptions","organizations_url":"https://api.github.com/users/neongreen/orgs","repos_url":"https://api.github.com/users/neongreen/repos","events_url":"https://api.github.com/users/neongreen/events{/privacy}","received_events_url":"https://api.github.com/users/neongreen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mrkkrp/megaparsec/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mrkkrp/megaparsec/labels/discussion","name":"discussion","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mrkkrp/megaparsec/milestones/1","html_url":"https://github.com/mrkkrp/megaparsec/milestones/4.0.0","labels_url":"https://api.github.com/repos/mrkkrp/megaparsec/milestones/1/labels","id":1233753,"number":1,"title":"4.0.0","description":null,"creator":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":19,"state":"open","created_at":"2015-07-30T16:13:19Z","updated_at":"2015-09-22T08:14:19Z","due_on":null,"closed_at":null},"comments":24,"created_at":"2015-09-21T17:44:21Z","updated_at":"2015-09-22T08:14:19Z","closed_at":null,"body":"Here's a Parsec parser:\r\n\r\n~~~ haskell\r\nimport Text.Parsec\r\nimport Text.Parsec.Language\r\nimport Text.Parsec.Lexer\r\n\r\ndecimal' = decimal (makeTokenParser haskellDef)\r\n\r\npair = do\r\n  char '{'      <?> \"opening brace\"\r\n  a <- decimal' <?> \"1st number\"\r\n  char ','      <?> \"comma\"\r\n  b <- decimal' <?> \"2nd number\"\r\n  char '}'      <?> \"closing brace\"\r\n  eof\r\n  return (a, b)\r\n~~~\r\n\r\nIt gives the following errors on various inputs:\r\n\r\n~~~\r\n> pair \"{1a,456}\"\r\n*** Exception: (line 1, column 3):\r\nunexpected \"a\"\r\nexpecting digit or comma\r\n\r\n> pair \"{a,456}\"\r\n*** Exception: (line 1, column 2):\r\nunexpected \"a\"\r\nexpecting 1st number\r\n~~~\r\n\r\nHere's an equivalent Megaparsec parser:\r\n\r\n~~~ haskell\r\nimport Text.Megaparsec\r\nimport Text.Megaparsec.Lexer\r\n\r\npair = do\r\n  char '{'     <?> \"opening brace\"\r\n  a <- decimal <?> \"1st number\"\r\n  char ','     <?> \"comma\"\r\n  b <- decimal <?> \"2nd number\"\r\n  char '}'     <?> \"closing brace\"\r\n  eof\r\n  return (a, b)\r\n~~~\r\n\r\nAnd its errors:\r\n\r\n~~~\r\n> pair \"{1a,456}\"\r\n*** Exception: line 1, column 3:\r\nunexpected 'a'\r\nexpecting 1st number or comma\r\n\r\n> pair \"{a,456}\"\r\n*** Exception: line 1, column 2:\r\nunexpected 'a'\r\nexpecting 1st number\r\n~~~\r\n\r\nParsec's error when parsing `{1a,456}` seems more helpful to me (it would be even more apparent if instead of `decimal` there was a more complicated parser). Am I mistaken?\r\n"}}