{"action":"created","comment":{"url":"https://api.github.com/repos/purescript/purescript/pulls/comments/45852929","id":45852929,"diff_hunk":"@@ -184,6 +185,23 @@ data HintCategory\n \n data ErrorMessage = ErrorMessage [ErrorMessageHint] SimpleErrorMessage deriving (Show)\n \n+-- | Get the source span for an error\n+errorSpan :: ErrorMessage -> SourceSpan\n+errorSpan = fromMaybe (error \"errorSpan: no position information\") . findHint matchSpan\n+  where\n+  matchSpan (PositionedError ss) = Just ss\n+  matchSpan _ = Nothing\n+\n+-- | Get the module name for an error\n+errorModule :: ErrorMessage -> ModuleName\n+errorModule = fromMaybe (error \"errorModule: no position information\") . findHint matchModule","path":"src/Language/PureScript/Errors.hs","position":21,"original_position":21,"commit_id":"8ef4afa47b6c0cc3254c3c21965b97f3b6e0aa18","original_commit_id":"8ef4afa47b6c0cc3254c3c21965b97f3b6e0aa18","user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"body":"Is it safe to do this? I know we _should_ have module info included with every warning and error, but I'm not 100% confident that they all do right now. ","created_at":"2015-11-25T10:48:27Z","updated_at":"2015-11-25T10:48:27Z","html_url":"https://github.com/purescript/purescript/pull/1671#discussion_r45852929","pull_request_url":"https://api.github.com/repos/purescript/purescript/pulls/1671","_links":{"self":{"href":"https://api.github.com/repos/purescript/purescript/pulls/comments/45852929"},"html":{"href":"https://github.com/purescript/purescript/pull/1671#discussion_r45852929"},"pull_request":{"href":"https://api.github.com/repos/purescript/purescript/pulls/1671"}}},"pull_request":{"url":"https://api.github.com/repos/purescript/purescript/pulls/1671","id":51748113,"html_url":"https://github.com/purescript/purescript/pull/1671","diff_url":"https://github.com/purescript/purescript/pull/1671.diff","patch_url":"https://github.com/purescript/purescript/pull/1671.patch","issue_url":"https://api.github.com/repos/purescript/purescript/issues/1671","number":1671,"state":"open","locked":false,"title":"Fix #1523, add --json-errors flag.","user":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"body":"@kRITZCREEK @nwolverson @garyb How does this look?\r\n\r\nThanks.","created_at":"2015-11-25T03:18:21Z","updated_at":"2015-11-25T10:48:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f8e1b88092a9086ba48454510dd965241bca7bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/purescript/purescript/pulls/1671/commits","review_comments_url":"https://api.github.com/repos/purescript/purescript/pulls/1671/comments","review_comment_url":"https://api.github.com/repos/purescript/purescript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/1671/comments","statuses_url":"https://api.github.com/repos/purescript/purescript/statuses/8ef4afa47b6c0cc3254c3c21965b97f3b6e0aa18","head":{"label":"purescript:json-errors","ref":"json-errors","sha":"8ef4afa47b6c0cc3254c3c21965b97f3b6e0aa18","user":{"login":"purescript","id":6556677,"avatar_url":"https://avatars.githubusercontent.com/u/6556677?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript","html_url":"https://github.com/purescript","followers_url":"https://api.github.com/users/purescript/followers","following_url":"https://api.github.com/users/purescript/following{/other_user}","gists_url":"https://api.github.com/users/purescript/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript/subscriptions","organizations_url":"https://api.github.com/users/purescript/orgs","repos_url":"https://api.github.com/users/purescript/repos","events_url":"https://api.github.com/users/purescript/events{/privacy}","received_events_url":"https://api.github.com/users/purescript/received_events","type":"Organization","site_admin":false},"repo":{"id":13206906,"name":"purescript","full_name":"purescript/purescript","owner":{"login":"purescript","id":6556677,"avatar_url":"https://avatars.githubusercontent.com/u/6556677?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript","html_url":"https://github.com/purescript","followers_url":"https://api.github.com/users/purescript/followers","following_url":"https://api.github.com/users/purescript/following{/other_user}","gists_url":"https://api.github.com/users/purescript/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript/subscriptions","organizations_url":"https://api.github.com/users/purescript/orgs","repos_url":"https://api.github.com/users/purescript/repos","events_url":"https://api.github.com/users/purescript/events{/privacy}","received_events_url":"https://api.github.com/users/purescript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purescript/purescript","description":"A small strongly typed language that compiles to Javascript","fork":false,"url":"https://api.github.com/repos/purescript/purescript","forks_url":"https://api.github.com/repos/purescript/purescript/forks","keys_url":"https://api.github.com/repos/purescript/purescript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purescript/purescript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purescript/purescript/teams","hooks_url":"https://api.github.com/repos/purescript/purescript/hooks","issue_events_url":"https://api.github.com/repos/purescript/purescript/issues/events{/number}","events_url":"https://api.github.com/repos/purescript/purescript/events","assignees_url":"https://api.github.com/repos/purescript/purescript/assignees{/user}","branches_url":"https://api.github.com/repos/purescript/purescript/branches{/branch}","tags_url":"https://api.github.com/repos/purescript/purescript/tags","blobs_url":"https://api.github.com/repos/purescript/purescript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purescript/purescript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purescript/purescript/git/refs{/sha}","trees_url":"https://api.github.com/repos/purescript/purescript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purescript/purescript/statuses/{sha}","languages_url":"https://api.github.com/repos/purescript/purescript/languages","stargazers_url":"https://api.github.com/repos/purescript/purescript/stargazers","contributors_url":"https://api.github.com/repos/purescript/purescript/contributors","subscribers_url":"https://api.github.com/repos/purescript/purescript/subscribers","subscription_url":"https://api.github.com/repos/purescript/purescript/subscription","commits_url":"https://api.github.com/repos/purescript/purescript/commits{/sha}","git_commits_url":"https://api.github.com/repos/purescript/purescript/git/commits{/sha}","comments_url":"https://api.github.com/repos/purescript/purescript/comments{/number}","issue_comment_url":"https://api.github.com/repos/purescript/purescript/issues/comments{/number}","contents_url":"https://api.github.com/repos/purescript/purescript/contents/{+path}","compare_url":"https://api.github.com/repos/purescript/purescript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purescript/purescript/merges","archive_url":"https://api.github.com/repos/purescript/purescript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purescript/purescript/downloads","issues_url":"https://api.github.com/repos/purescript/purescript/issues{/number}","pulls_url":"https://api.github.com/repos/purescript/purescript/pulls{/number}","milestones_url":"https://api.github.com/repos/purescript/purescript/milestones{/number}","notifications_url":"https://api.github.com/repos/purescript/purescript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purescript/purescript/labels{/name}","releases_url":"https://api.github.com/repos/purescript/purescript/releases{/id}","created_at":"2013-09-30T05:29:23Z","updated_at":"2015-11-24T11:29:54Z","pushed_at":"2015-11-25T03:18:22Z","git_url":"git://github.com/purescript/purescript.git","ssh_url":"git@github.com:purescript/purescript.git","clone_url":"https://github.com/purescript/purescript.git","svn_url":"https://github.com/purescript/purescript","homepage":"http://purescript.org","size":6304,"stargazers_count":1934,"watchers_count":1934,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":146,"forks":170,"open_issues":146,"watchers":1934,"default_branch":"master"}},"base":{"label":"purescript:master","ref":"master","sha":"948e45d2db195c1af1392625a6dbbe33cf831e65","user":{"login":"purescript","id":6556677,"avatar_url":"https://avatars.githubusercontent.com/u/6556677?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript","html_url":"https://github.com/purescript","followers_url":"https://api.github.com/users/purescript/followers","following_url":"https://api.github.com/users/purescript/following{/other_user}","gists_url":"https://api.github.com/users/purescript/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript/subscriptions","organizations_url":"https://api.github.com/users/purescript/orgs","repos_url":"https://api.github.com/users/purescript/repos","events_url":"https://api.github.com/users/purescript/events{/privacy}","received_events_url":"https://api.github.com/users/purescript/received_events","type":"Organization","site_admin":false},"repo":{"id":13206906,"name":"purescript","full_name":"purescript/purescript","owner":{"login":"purescript","id":6556677,"avatar_url":"https://avatars.githubusercontent.com/u/6556677?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript","html_url":"https://github.com/purescript","followers_url":"https://api.github.com/users/purescript/followers","following_url":"https://api.github.com/users/purescript/following{/other_user}","gists_url":"https://api.github.com/users/purescript/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript/subscriptions","organizations_url":"https://api.github.com/users/purescript/orgs","repos_url":"https://api.github.com/users/purescript/repos","events_url":"https://api.github.com/users/purescript/events{/privacy}","received_events_url":"https://api.github.com/users/purescript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purescript/purescript","description":"A small strongly typed language that compiles to Javascript","fork":false,"url":"https://api.github.com/repos/purescript/purescript","forks_url":"https://api.github.com/repos/purescript/purescript/forks","keys_url":"https://api.github.com/repos/purescript/purescript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purescript/purescript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purescript/purescript/teams","hooks_url":"https://api.github.com/repos/purescript/purescript/hooks","issue_events_url":"https://api.github.com/repos/purescript/purescript/issues/events{/number}","events_url":"https://api.github.com/repos/purescript/purescript/events","assignees_url":"https://api.github.com/repos/purescript/purescript/assignees{/user}","branches_url":"https://api.github.com/repos/purescript/purescript/branches{/branch}","tags_url":"https://api.github.com/repos/purescript/purescript/tags","blobs_url":"https://api.github.com/repos/purescript/purescript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purescript/purescript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purescript/purescript/git/refs{/sha}","trees_url":"https://api.github.com/repos/purescript/purescript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purescript/purescript/statuses/{sha}","languages_url":"https://api.github.com/repos/purescript/purescript/languages","stargazers_url":"https://api.github.com/repos/purescript/purescript/stargazers","contributors_url":"https://api.github.com/repos/purescript/purescript/contributors","subscribers_url":"https://api.github.com/repos/purescript/purescript/subscribers","subscription_url":"https://api.github.com/repos/purescript/purescript/subscription","commits_url":"https://api.github.com/repos/purescript/purescript/commits{/sha}","git_commits_url":"https://api.github.com/repos/purescript/purescript/git/commits{/sha}","comments_url":"https://api.github.com/repos/purescript/purescript/comments{/number}","issue_comment_url":"https://api.github.com/repos/purescript/purescript/issues/comments{/number}","contents_url":"https://api.github.com/repos/purescript/purescript/contents/{+path}","compare_url":"https://api.github.com/repos/purescript/purescript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purescript/purescript/merges","archive_url":"https://api.github.com/repos/purescript/purescript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purescript/purescript/downloads","issues_url":"https://api.github.com/repos/purescript/purescript/issues{/number}","pulls_url":"https://api.github.com/repos/purescript/purescript/pulls{/number}","milestones_url":"https://api.github.com/repos/purescript/purescript/milestones{/number}","notifications_url":"https://api.github.com/repos/purescript/purescript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purescript/purescript/labels{/name}","releases_url":"https://api.github.com/repos/purescript/purescript/releases{/id}","created_at":"2013-09-30T05:29:23Z","updated_at":"2015-11-24T11:29:54Z","pushed_at":"2015-11-25T03:18:22Z","git_url":"git://github.com/purescript/purescript.git","ssh_url":"git@github.com:purescript/purescript.git","clone_url":"https://github.com/purescript/purescript.git","svn_url":"https://github.com/purescript/purescript","homepage":"http://purescript.org","size":6304,"stargazers_count":1934,"watchers_count":1934,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":146,"forks":170,"open_issues":146,"watchers":1934,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/purescript/purescript/pulls/1671"},"html":{"href":"https://github.com/purescript/purescript/pull/1671"},"issue":{"href":"https://api.github.com/repos/purescript/purescript/issues/1671"},"comments":{"href":"https://api.github.com/repos/purescript/purescript/issues/1671/comments"},"review_comments":{"href":"https://api.github.com/repos/purescript/purescript/pulls/1671/comments"},"review_comment":{"href":"https://api.github.com/repos/purescript/purescript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/purescript/purescript/pulls/1671/commits"},"statuses":{"href":"https://api.github.com/repos/purescript/purescript/statuses/8ef4afa47b6c0cc3254c3c21965b97f3b6e0aa18"}}}}