{"action":"created","comment":{"url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/comments/93914404","pull_request_review_id":14445939,"id":93914404,"diff_hunk":"@@ -2787,64 +2787,62 @@\n   }\n   S.prop = def('prop', {a: [Accessible]}, [$.String, a, b], prop);\n \n-  //# get :: Accessible a => TypeRep b -> String -> a -> Maybe b\n+  //# get :: Accessible a => (b -> Boolean) -> String -> a -> Maybe c\n   //.\n-  //. Takes a [type representative](#type-representatives), a property\n-  //. name, and an object and returns Just the value of the specified object\n-  //. property if it is of the specified type (according to [`is`](#is));\n+  //. Takes a predicate, a property name, and an object and returns Just the\n+  //. value of the specified object property if it passes the given predicate;\n   //. Nothing otherwise.\n   //.\n-  //. The `Object` type representative may be used as a catch-all since most\n-  //. values have `Object.prototype` in their prototype chains.\n-  //.\n   //. See also [`gets`](#gets) and [`prop`](#prop).\n   //.\n   //. ```javascript\n-  //. > S.get(Number, 'x', {x: 1, y: 2})\n+  //. > S.get(S.is(Number), 'x', {x: 1, y: 2})\n   //. Just(1)\n   //.\n-  //. > S.get(Number, 'x', {x: '1', y: '2'})\n+  //. > S.get(S.is(Number), 'x', {x: '1', y: '2'})\n   //. Nothing\n   //.\n-  //. > S.get(Number, 'x', {})\n+  //. > S.get(S.is(Number), 'x', {})\n   //. Nothing\n   //. ```\n-  function get(typeRep, key, obj) {\n+  function get(pred, key, obj) {\n     var x = obj[key];\n-    return is(typeRep, x) ? Just(x) : Nothing;\n+    return key in obj && pred(x) ? Just(x) : Nothing;","path":"index.js","position":36,"original_position":36,"commit_id":"e9490adff1f4b3a456f23ae86efab6a0c3eec960","original_commit_id":"e9490adff1f4b3a456f23ae86efab6a0c3eec960","user":{"login":"davidchambers","id":210406,"avatar_url":"https://avatars.githubusercontent.com/u/210406?v=3","gravatar_id":"","url":"https://api.github.com/users/davidchambers","html_url":"https://github.com/davidchambers","followers_url":"https://api.github.com/users/davidchambers/followers","following_url":"https://api.github.com/users/davidchambers/following{/other_user}","gists_url":"https://api.github.com/users/davidchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/davidchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidchambers/subscriptions","organizations_url":"https://api.github.com/users/davidchambers/orgs","repos_url":"https://api.github.com/users/davidchambers/repos","events_url":"https://api.github.com/users/davidchambers/events{/privacy}","received_events_url":"https://api.github.com/users/davidchambers/received_events","type":"User","site_admin":false},"body":"We shouldn't attempt `obj[key]` before the `key in obj` check. Let's replace the two lines above with the following:\r\n\r\n```javascript\r\nreturn key in obj && pred(obj[key]) ? Just(obj[key]) : Nothing;\r\n```\r\n","created_at":"2016-12-27T09:52:07Z","updated_at":"2016-12-27T09:52:07Z","html_url":"https://github.com/sanctuary-js/sanctuary/pull/191#discussion_r93914404","pull_request_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/comments/93914404"},"html":{"href":"https://github.com/sanctuary-js/sanctuary/pull/191#discussion_r93914404"},"pull_request":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191","id":67606625,"html_url":"https://github.com/sanctuary-js/sanctuary/pull/191","diff_url":"https://github.com/sanctuary-js/sanctuary/pull/191.diff","patch_url":"https://github.com/sanctuary-js/sanctuary/pull/191.patch","issue_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/191","number":191,"state":"open","locked":false,"title":"Change type validators to use predicate instead of TypeRep","user":{"login":"Avaq","id":1217745,"avatar_url":"https://avatars.githubusercontent.com/u/1217745?v=3","gravatar_id":"","url":"https://api.github.com/users/Avaq","html_url":"https://github.com/Avaq","followers_url":"https://api.github.com/users/Avaq/followers","following_url":"https://api.github.com/users/Avaq/following{/other_user}","gists_url":"https://api.github.com/users/Avaq/gists{/gist_id}","starred_url":"https://api.github.com/users/Avaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Avaq/subscriptions","organizations_url":"https://api.github.com/users/Avaq/orgs","repos_url":"https://api.github.com/users/Avaq/repos","events_url":"https://api.github.com/users/Avaq/events{/privacy}","received_events_url":"https://api.github.com/users/Avaq/received_events","type":"User","site_admin":false},"body":"Commit description:\r\n\r\n> This commit will close #149 by changing all functions\r\n> that have built-in type validation to use predicates\r\n> instead of TypeReps to perform their validations.\r\n> \r\n> The functions affected are:\r\n> - get()\r\n> - gets()\r\n> - parseJson()\r\n> \r\n> The only function untouched is `is()`, for it is used\r\n> to turn a TypeRep into a predicate.\r\n","created_at":"2016-04-23T13:24:32Z","updated_at":"2016-12-27T09:52:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c92a8b16cf9359c43a80bb761c0e64ed7309d96d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191/commits","review_comments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191/comments","review_comment_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/191/comments","statuses_url":"https://api.github.com/repos/sanctuary-js/sanctuary/statuses/e9490adff1f4b3a456f23ae86efab6a0c3eec960","head":{"label":"sanctuary-js:av-predicate-type-validation","ref":"av-predicate-type-validation","sha":"e9490adff1f4b3a456f23ae86efab6a0c3eec960","user":{"login":"sanctuary-js","id":18357498,"avatar_url":"https://avatars.githubusercontent.com/u/18357498?v=3","gravatar_id":"","url":"https://api.github.com/users/sanctuary-js","html_url":"https://github.com/sanctuary-js","followers_url":"https://api.github.com/users/sanctuary-js/followers","following_url":"https://api.github.com/users/sanctuary-js/following{/other_user}","gists_url":"https://api.github.com/users/sanctuary-js/gists{/gist_id}","starred_url":"https://api.github.com/users/sanctuary-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanctuary-js/subscriptions","organizations_url":"https://api.github.com/users/sanctuary-js/orgs","repos_url":"https://api.github.com/users/sanctuary-js/repos","events_url":"https://api.github.com/users/sanctuary-js/events{/privacy}","received_events_url":"https://api.github.com/users/sanctuary-js/received_events","type":"Organization","site_admin":false},"repo":{"id":29455960,"name":"sanctuary","full_name":"sanctuary-js/sanctuary","owner":{"login":"sanctuary-js","id":18357498,"avatar_url":"https://avatars.githubusercontent.com/u/18357498?v=3","gravatar_id":"","url":"https://api.github.com/users/sanctuary-js","html_url":"https://github.com/sanctuary-js","followers_url":"https://api.github.com/users/sanctuary-js/followers","following_url":"https://api.github.com/users/sanctuary-js/following{/other_user}","gists_url":"https://api.github.com/users/sanctuary-js/gists{/gist_id}","starred_url":"https://api.github.com/users/sanctuary-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanctuary-js/subscriptions","organizations_url":"https://api.github.com/users/sanctuary-js/orgs","repos_url":"https://api.github.com/users/sanctuary-js/repos","events_url":"https://api.github.com/users/sanctuary-js/events{/privacy}","received_events_url":"https://api.github.com/users/sanctuary-js/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sanctuary-js/sanctuary","description":":see_no_evil: Refuge from unsafe JavaScript","fork":false,"url":"https://api.github.com/repos/sanctuary-js/sanctuary","forks_url":"https://api.github.com/repos/sanctuary-js/sanctuary/forks","keys_url":"https://api.github.com/repos/sanctuary-js/sanctuary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanctuary-js/sanctuary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanctuary-js/sanctuary/teams","hooks_url":"https://api.github.com/repos/sanctuary-js/sanctuary/hooks","issue_events_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/events{/number}","events_url":"https://api.github.com/repos/sanctuary-js/sanctuary/events","assignees_url":"https://api.github.com/repos/sanctuary-js/sanctuary/assignees{/user}","branches_url":"https://api.github.com/repos/sanctuary-js/sanctuary/branches{/branch}","tags_url":"https://api.github.com/repos/sanctuary-js/sanctuary/tags","blobs_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanctuary-js/sanctuary/statuses/{sha}","languages_url":"https://api.github.com/repos/sanctuary-js/sanctuary/languages","stargazers_url":"https://api.github.com/repos/sanctuary-js/sanctuary/stargazers","contributors_url":"https://api.github.com/repos/sanctuary-js/sanctuary/contributors","subscribers_url":"https://api.github.com/repos/sanctuary-js/sanctuary/subscribers","subscription_url":"https://api.github.com/repos/sanctuary-js/sanctuary/subscription","commits_url":"https://api.github.com/repos/sanctuary-js/sanctuary/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanctuary-js/sanctuary/contents/{+path}","compare_url":"https://api.github.com/repos/sanctuary-js/sanctuary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanctuary-js/sanctuary/merges","archive_url":"https://api.github.com/repos/sanctuary-js/sanctuary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanctuary-js/sanctuary/downloads","issues_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues{/number}","pulls_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls{/number}","milestones_url":"https://api.github.com/repos/sanctuary-js/sanctuary/milestones{/number}","notifications_url":"https://api.github.com/repos/sanctuary-js/sanctuary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanctuary-js/sanctuary/labels{/name}","releases_url":"https://api.github.com/repos/sanctuary-js/sanctuary/releases{/id}","deployments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/deployments","created_at":"2015-01-19T05:52:10Z","updated_at":"2016-12-25T16:30:04Z","pushed_at":"2016-12-27T09:40:22Z","git_url":"git://github.com/sanctuary-js/sanctuary.git","ssh_url":"git@github.com:sanctuary-js/sanctuary.git","clone_url":"https://github.com/sanctuary-js/sanctuary.git","svn_url":"https://github.com/sanctuary-js/sanctuary","homepage":"https://sanctuary.js.org","size":947,"stargazers_count":573,"watchers_count":573,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":32,"forks":34,"open_issues":32,"watchers":573,"default_branch":"master"}},"base":{"label":"sanctuary-js:master","ref":"master","sha":"bd2fb5ceca7dd967522591e4450bf331bbacd316","user":{"login":"sanctuary-js","id":18357498,"avatar_url":"https://avatars.githubusercontent.com/u/18357498?v=3","gravatar_id":"","url":"https://api.github.com/users/sanctuary-js","html_url":"https://github.com/sanctuary-js","followers_url":"https://api.github.com/users/sanctuary-js/followers","following_url":"https://api.github.com/users/sanctuary-js/following{/other_user}","gists_url":"https://api.github.com/users/sanctuary-js/gists{/gist_id}","starred_url":"https://api.github.com/users/sanctuary-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanctuary-js/subscriptions","organizations_url":"https://api.github.com/users/sanctuary-js/orgs","repos_url":"https://api.github.com/users/sanctuary-js/repos","events_url":"https://api.github.com/users/sanctuary-js/events{/privacy}","received_events_url":"https://api.github.com/users/sanctuary-js/received_events","type":"Organization","site_admin":false},"repo":{"id":29455960,"name":"sanctuary","full_name":"sanctuary-js/sanctuary","owner":{"login":"sanctuary-js","id":18357498,"avatar_url":"https://avatars.githubusercontent.com/u/18357498?v=3","gravatar_id":"","url":"https://api.github.com/users/sanctuary-js","html_url":"https://github.com/sanctuary-js","followers_url":"https://api.github.com/users/sanctuary-js/followers","following_url":"https://api.github.com/users/sanctuary-js/following{/other_user}","gists_url":"https://api.github.com/users/sanctuary-js/gists{/gist_id}","starred_url":"https://api.github.com/users/sanctuary-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanctuary-js/subscriptions","organizations_url":"https://api.github.com/users/sanctuary-js/orgs","repos_url":"https://api.github.com/users/sanctuary-js/repos","events_url":"https://api.github.com/users/sanctuary-js/events{/privacy}","received_events_url":"https://api.github.com/users/sanctuary-js/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sanctuary-js/sanctuary","description":":see_no_evil: Refuge from unsafe JavaScript","fork":false,"url":"https://api.github.com/repos/sanctuary-js/sanctuary","forks_url":"https://api.github.com/repos/sanctuary-js/sanctuary/forks","keys_url":"https://api.github.com/repos/sanctuary-js/sanctuary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanctuary-js/sanctuary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanctuary-js/sanctuary/teams","hooks_url":"https://api.github.com/repos/sanctuary-js/sanctuary/hooks","issue_events_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/events{/number}","events_url":"https://api.github.com/repos/sanctuary-js/sanctuary/events","assignees_url":"https://api.github.com/repos/sanctuary-js/sanctuary/assignees{/user}","branches_url":"https://api.github.com/repos/sanctuary-js/sanctuary/branches{/branch}","tags_url":"https://api.github.com/repos/sanctuary-js/sanctuary/tags","blobs_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanctuary-js/sanctuary/statuses/{sha}","languages_url":"https://api.github.com/repos/sanctuary-js/sanctuary/languages","stargazers_url":"https://api.github.com/repos/sanctuary-js/sanctuary/stargazers","contributors_url":"https://api.github.com/repos/sanctuary-js/sanctuary/contributors","subscribers_url":"https://api.github.com/repos/sanctuary-js/sanctuary/subscribers","subscription_url":"https://api.github.com/repos/sanctuary-js/sanctuary/subscription","commits_url":"https://api.github.com/repos/sanctuary-js/sanctuary/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanctuary-js/sanctuary/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanctuary-js/sanctuary/contents/{+path}","compare_url":"https://api.github.com/repos/sanctuary-js/sanctuary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanctuary-js/sanctuary/merges","archive_url":"https://api.github.com/repos/sanctuary-js/sanctuary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanctuary-js/sanctuary/downloads","issues_url":"https://api.github.com/repos/sanctuary-js/sanctuary/issues{/number}","pulls_url":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls{/number}","milestones_url":"https://api.github.com/repos/sanctuary-js/sanctuary/milestones{/number}","notifications_url":"https://api.github.com/repos/sanctuary-js/sanctuary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanctuary-js/sanctuary/labels{/name}","releases_url":"https://api.github.com/repos/sanctuary-js/sanctuary/releases{/id}","deployments_url":"https://api.github.com/repos/sanctuary-js/sanctuary/deployments","created_at":"2015-01-19T05:52:10Z","updated_at":"2016-12-25T16:30:04Z","pushed_at":"2016-12-27T09:40:22Z","git_url":"git://github.com/sanctuary-js/sanctuary.git","ssh_url":"git@github.com:sanctuary-js/sanctuary.git","clone_url":"https://github.com/sanctuary-js/sanctuary.git","svn_url":"https://github.com/sanctuary-js/sanctuary","homepage":"https://sanctuary.js.org","size":947,"stargazers_count":573,"watchers_count":573,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":32,"forks":34,"open_issues":32,"watchers":573,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191"},"html":{"href":"https://github.com/sanctuary-js/sanctuary/pull/191"},"issue":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/191"},"comments":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/sanctuary-js/sanctuary/statuses/e9490adff1f4b3a456f23ae86efab6a0c3eec960"}}}}
{"actor":{"display_login":"davidchambers"}}