{"action":"created","comment":{"url":"https://api.github.com/repos/kolmodin/binary/pulls/comments/25183437","id":25183437,"diff_hunk":"@@ -382,7 +382,11 @@ instance Binary Char where\n                                 z <- liftM (xor 0x80) getByte\n                                 return (z .|. shiftL6 (y .|. shiftL6\n                                         (x .|. shiftL6 (xor 0xf0 w))))\n-        return $! chr r\n+        getChr r\n+      where\n+        getChr w\n+          | w <= 0x10ffff = return $! toEnum $ fromEnum w\n+          | otherwise = fail \"Not a valid Unicode code point!\"","path":"src/Data/Binary/Class.hs","position":18,"original_position":18,"commit_id":"62c41d79c4df5e26c6d4b39a56b7f54896eaa3ff","original_commit_id":"62c41d79c4df5e26c6d4b39a56b7f54896eaa3ff","user":{"login":"tibbe","id":17277,"avatar_url":"https://avatars.githubusercontent.com/u/17277?v=3","gravatar_id":"","url":"https://api.github.com/users/tibbe","html_url":"https://github.com/tibbe","followers_url":"https://api.github.com/users/tibbe/followers","following_url":"https://api.github.com/users/tibbe/following{/other_user}","gists_url":"https://api.github.com/users/tibbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tibbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tibbe/subscriptions","organizations_url":"https://api.github.com/users/tibbe/orgs","repos_url":"https://api.github.com/users/tibbe/repos","events_url":"https://api.github.com/users/tibbe/events{/privacy}","received_events_url":"https://api.github.com/users/tibbe/received_events","type":"User","site_admin":false},"body":"Please include the actual value so the user can debug their data.","created_at":"2015-02-23T17:37:09Z","updated_at":"2015-02-23T17:37:09Z","html_url":"https://github.com/kolmodin/binary/pull/70#discussion_r25183437","pull_request_url":"https://api.github.com/repos/kolmodin/binary/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/comments/25183437"},"html":{"href":"https://github.com/kolmodin/binary/pull/70#discussion_r25183437"},"pull_request":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/kolmodin/binary/pulls/70","id":29720557,"html_url":"https://github.com/kolmodin/binary/pull/70","diff_url":"https://github.com/kolmodin/binary/pull/70.diff","patch_url":"https://github.com/kolmodin/binary/pull/70.patch","issue_url":"https://api.github.com/repos/kolmodin/binary/issues/70","number":70,"state":"closed","locked":false,"title":"Make get :: Get Char total","user":{"login":"ttuegel","id":563054,"avatar_url":"https://avatars.githubusercontent.com/u/563054?v=3","gravatar_id":"","url":"https://api.github.com/users/ttuegel","html_url":"https://github.com/ttuegel","followers_url":"https://api.github.com/users/ttuegel/followers","following_url":"https://api.github.com/users/ttuegel/following{/other_user}","gists_url":"https://api.github.com/users/ttuegel/gists{/gist_id}","starred_url":"https://api.github.com/users/ttuegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttuegel/subscriptions","organizations_url":"https://api.github.com/users/ttuegel/orgs","repos_url":"https://api.github.com/users/ttuegel/repos","events_url":"https://api.github.com/users/ttuegel/events{/privacy}","received_events_url":"https://api.github.com/users/ttuegel/received_events","type":"User","site_admin":false},"body":"The old Binary instance for Char used Data.Char.chr, which calls error\r\nif given an invalid code point. The instance is modified to call fail\r\ninstead of error on invalid code points, which is total (within the Get\r\nMonad). Calls to error inside Get will escape decodeOrFail.\r\n\r\nThis was discovered in `Cabal-1.22.0.0`, because we lean pretty heavily on `binary` now.","created_at":"2015-02-20T18:51:52Z","updated_at":"2015-02-23T17:37:09Z","closed_at":"2015-02-23T11:31:39Z","merged_at":"2015-02-23T11:31:39Z","merge_commit_sha":"992714b799dd5842cccc8897d8b1cfacc4317819","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kolmodin/binary/pulls/70/commits","review_comments_url":"https://api.github.com/repos/kolmodin/binary/pulls/70/comments","review_comment_url":"https://api.github.com/repos/kolmodin/binary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kolmodin/binary/issues/70/comments","statuses_url":"https://api.github.com/repos/kolmodin/binary/statuses/62c41d79c4df5e26c6d4b39a56b7f54896eaa3ff","head":{"label":"ttuegel:total-char","ref":"total-char","sha":"62c41d79c4df5e26c6d4b39a56b7f54896eaa3ff","user":{"login":"ttuegel","id":563054,"avatar_url":"https://avatars.githubusercontent.com/u/563054?v=3","gravatar_id":"","url":"https://api.github.com/users/ttuegel","html_url":"https://github.com/ttuegel","followers_url":"https://api.github.com/users/ttuegel/followers","following_url":"https://api.github.com/users/ttuegel/following{/other_user}","gists_url":"https://api.github.com/users/ttuegel/gists{/gist_id}","starred_url":"https://api.github.com/users/ttuegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttuegel/subscriptions","organizations_url":"https://api.github.com/users/ttuegel/orgs","repos_url":"https://api.github.com/users/ttuegel/repos","events_url":"https://api.github.com/users/ttuegel/events{/privacy}","received_events_url":"https://api.github.com/users/ttuegel/received_events","type":"User","site_admin":false},"repo":{"id":31076034,"name":"binary","full_name":"ttuegel/binary","owner":{"login":"ttuegel","id":563054,"avatar_url":"https://avatars.githubusercontent.com/u/563054?v=3","gravatar_id":"","url":"https://api.github.com/users/ttuegel","html_url":"https://github.com/ttuegel","followers_url":"https://api.github.com/users/ttuegel/followers","following_url":"https://api.github.com/users/ttuegel/following{/other_user}","gists_url":"https://api.github.com/users/ttuegel/gists{/gist_id}","starred_url":"https://api.github.com/users/ttuegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttuegel/subscriptions","organizations_url":"https://api.github.com/users/ttuegel/orgs","repos_url":"https://api.github.com/users/ttuegel/repos","events_url":"https://api.github.com/users/ttuegel/events{/privacy}","received_events_url":"https://api.github.com/users/ttuegel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ttuegel/binary","description":"Efficient, pure binary serialisation using ByteStrings in Haskell.","fork":true,"url":"https://api.github.com/repos/ttuegel/binary","forks_url":"https://api.github.com/repos/ttuegel/binary/forks","keys_url":"https://api.github.com/repos/ttuegel/binary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ttuegel/binary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ttuegel/binary/teams","hooks_url":"https://api.github.com/repos/ttuegel/binary/hooks","issue_events_url":"https://api.github.com/repos/ttuegel/binary/issues/events{/number}","events_url":"https://api.github.com/repos/ttuegel/binary/events","assignees_url":"https://api.github.com/repos/ttuegel/binary/assignees{/user}","branches_url":"https://api.github.com/repos/ttuegel/binary/branches{/branch}","tags_url":"https://api.github.com/repos/ttuegel/binary/tags","blobs_url":"https://api.github.com/repos/ttuegel/binary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ttuegel/binary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ttuegel/binary/git/refs{/sha}","trees_url":"https://api.github.com/repos/ttuegel/binary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ttuegel/binary/statuses/{sha}","languages_url":"https://api.github.com/repos/ttuegel/binary/languages","stargazers_url":"https://api.github.com/repos/ttuegel/binary/stargazers","contributors_url":"https://api.github.com/repos/ttuegel/binary/contributors","subscribers_url":"https://api.github.com/repos/ttuegel/binary/subscribers","subscription_url":"https://api.github.com/repos/ttuegel/binary/subscription","commits_url":"https://api.github.com/repos/ttuegel/binary/commits{/sha}","git_commits_url":"https://api.github.com/repos/ttuegel/binary/git/commits{/sha}","comments_url":"https://api.github.com/repos/ttuegel/binary/comments{/number}","issue_comment_url":"https://api.github.com/repos/ttuegel/binary/issues/comments{/number}","contents_url":"https://api.github.com/repos/ttuegel/binary/contents/{+path}","compare_url":"https://api.github.com/repos/ttuegel/binary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ttuegel/binary/merges","archive_url":"https://api.github.com/repos/ttuegel/binary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ttuegel/binary/downloads","issues_url":"https://api.github.com/repos/ttuegel/binary/issues{/number}","pulls_url":"https://api.github.com/repos/ttuegel/binary/pulls{/number}","milestones_url":"https://api.github.com/repos/ttuegel/binary/milestones{/number}","notifications_url":"https://api.github.com/repos/ttuegel/binary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ttuegel/binary/labels{/name}","releases_url":"https://api.github.com/repos/ttuegel/binary/releases{/id}","created_at":"2015-02-20T17:29:04Z","updated_at":"2015-02-20T17:29:04Z","pushed_at":"2015-02-20T18:46:42Z","git_url":"git://github.com/ttuegel/binary.git","ssh_url":"git@github.com:ttuegel/binary.git","clone_url":"https://github.com/ttuegel/binary.git","svn_url":"https://github.com/ttuegel/binary","homepage":"","size":791,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kolmodin:master","ref":"master","sha":"ff9a48fb213c2d1fd2e58b19c92264a3efadff7a","user":{"login":"kolmodin","id":157261,"avatar_url":"https://avatars.githubusercontent.com/u/157261?v=3","gravatar_id":"","url":"https://api.github.com/users/kolmodin","html_url":"https://github.com/kolmodin","followers_url":"https://api.github.com/users/kolmodin/followers","following_url":"https://api.github.com/users/kolmodin/following{/other_user}","gists_url":"https://api.github.com/users/kolmodin/gists{/gist_id}","starred_url":"https://api.github.com/users/kolmodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolmodin/subscriptions","organizations_url":"https://api.github.com/users/kolmodin/orgs","repos_url":"https://api.github.com/users/kolmodin/repos","events_url":"https://api.github.com/users/kolmodin/events{/privacy}","received_events_url":"https://api.github.com/users/kolmodin/received_events","type":"User","site_admin":false},"repo":{"id":1352473,"name":"binary","full_name":"kolmodin/binary","owner":{"login":"kolmodin","id":157261,"avatar_url":"https://avatars.githubusercontent.com/u/157261?v=3","gravatar_id":"","url":"https://api.github.com/users/kolmodin","html_url":"https://github.com/kolmodin","followers_url":"https://api.github.com/users/kolmodin/followers","following_url":"https://api.github.com/users/kolmodin/following{/other_user}","gists_url":"https://api.github.com/users/kolmodin/gists{/gist_id}","starred_url":"https://api.github.com/users/kolmodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolmodin/subscriptions","organizations_url":"https://api.github.com/users/kolmodin/orgs","repos_url":"https://api.github.com/users/kolmodin/repos","events_url":"https://api.github.com/users/kolmodin/events{/privacy}","received_events_url":"https://api.github.com/users/kolmodin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kolmodin/binary","description":"Efficient, pure binary serialisation using ByteStrings in Haskell.","fork":false,"url":"https://api.github.com/repos/kolmodin/binary","forks_url":"https://api.github.com/repos/kolmodin/binary/forks","keys_url":"https://api.github.com/repos/kolmodin/binary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kolmodin/binary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kolmodin/binary/teams","hooks_url":"https://api.github.com/repos/kolmodin/binary/hooks","issue_events_url":"https://api.github.com/repos/kolmodin/binary/issues/events{/number}","events_url":"https://api.github.com/repos/kolmodin/binary/events","assignees_url":"https://api.github.com/repos/kolmodin/binary/assignees{/user}","branches_url":"https://api.github.com/repos/kolmodin/binary/branches{/branch}","tags_url":"https://api.github.com/repos/kolmodin/binary/tags","blobs_url":"https://api.github.com/repos/kolmodin/binary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kolmodin/binary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kolmodin/binary/git/refs{/sha}","trees_url":"https://api.github.com/repos/kolmodin/binary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kolmodin/binary/statuses/{sha}","languages_url":"https://api.github.com/repos/kolmodin/binary/languages","stargazers_url":"https://api.github.com/repos/kolmodin/binary/stargazers","contributors_url":"https://api.github.com/repos/kolmodin/binary/contributors","subscribers_url":"https://api.github.com/repos/kolmodin/binary/subscribers","subscription_url":"https://api.github.com/repos/kolmodin/binary/subscription","commits_url":"https://api.github.com/repos/kolmodin/binary/commits{/sha}","git_commits_url":"https://api.github.com/repos/kolmodin/binary/git/commits{/sha}","comments_url":"https://api.github.com/repos/kolmodin/binary/comments{/number}","issue_comment_url":"https://api.github.com/repos/kolmodin/binary/issues/comments{/number}","contents_url":"https://api.github.com/repos/kolmodin/binary/contents/{+path}","compare_url":"https://api.github.com/repos/kolmodin/binary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kolmodin/binary/merges","archive_url":"https://api.github.com/repos/kolmodin/binary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kolmodin/binary/downloads","issues_url":"https://api.github.com/repos/kolmodin/binary/issues{/number}","pulls_url":"https://api.github.com/repos/kolmodin/binary/pulls{/number}","milestones_url":"https://api.github.com/repos/kolmodin/binary/milestones{/number}","notifications_url":"https://api.github.com/repos/kolmodin/binary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kolmodin/binary/labels{/name}","releases_url":"https://api.github.com/repos/kolmodin/binary/releases{/id}","created_at":"2011-02-10T21:35:14Z","updated_at":"2015-02-23T17:29:37Z","pushed_at":"2015-02-23T17:30:00Z","git_url":"git://github.com/kolmodin/binary.git","ssh_url":"git@github.com:kolmodin/binary.git","clone_url":"https://github.com/kolmodin/binary.git","svn_url":"https://github.com/kolmodin/binary","homepage":"","size":1271,"stargazers_count":37,"watchers_count":37,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":26,"forks":22,"open_issues":26,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/70"},"html":{"href":"https://github.com/kolmodin/binary/pull/70"},"issue":{"href":"https://api.github.com/repos/kolmodin/binary/issues/70"},"comments":{"href":"https://api.github.com/repos/kolmodin/binary/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kolmodin/binary/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/kolmodin/binary/statuses/62c41d79c4df5e26c6d4b39a56b7f54896eaa3ff"}}}}