{"action":"created","issue":{"url":"https://api.github.com/repos/ramda/ramda/issues/1429","labels_url":"https://api.github.com/repos/ramda/ramda/issues/1429/labels{/name}","comments_url":"https://api.github.com/repos/ramda/ramda/issues/1429/comments","events_url":"https://api.github.com/repos/ramda/ramda/issues/1429/events","html_url":"https://github.com/ramda/ramda/pull/1429","id":110045254,"number":1429,"title":"define R.filter for Object","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":36,"created_at":"2015-10-06T16:13:29Z","updated_at":"2015-10-26T19:46:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ramda/ramda/pulls/1429","html_url":"https://github.com/ramda/ramda/pull/1429","diff_url":"https://github.com/ramda/ramda/pull/1429.diff","patch_url":"https://github.com/ramda/ramda/pull/1429.patch"},"body":"This change is warranted by many of the arguments made in #1426.\r\n\r\nWe have the elegant `R.map`, which applies the given function to exactly one argument, and the inelegant `R.mapObjIndexed` which applies the given function to `(value, key, object)`. [`R.pickBy`][1] falls between these two stools, applying the given function to *two* arguments.\r\n\r\nThis pull request:\r\n\r\n  - deprecates `R.pickBy`;\r\n  - defines `R.filter` for Object; and\r\n  - adds `R.filterObjIndexed`, which mirrors `R.mapObjIndexed`, to replace `R.pickBy` in contexts in which the key is relevant.\r\n\r\nI first suggested this change in https://github.com/ramda/ramda/pull/1265#issuecomment-120538941:\r\n\r\n> I think `R.pickBy` and `R.omitBy` should only pass the value to the predicate.\r\n>\r\n> I would then go a step further and support objects in `R.filter` (and by extension `R.reject`). We could then deprecate `R.pickBy` and `R.omitBy`.\r\n\r\nThe time is now right. :)\r\n\r\n\r\n[1]: http://ramdajs.com/0.17/docs/#pickBy\r\n"},"comment":{"url":"https://api.github.com/repos/ramda/ramda/issues/comments/151262640","html_url":"https://github.com/ramda/ramda/pull/1429#issuecomment-151262640","issue_url":"https://api.github.com/repos/ramda/ramda/issues/1429","id":151262640,"user":{"login":"CrossEye","id":151263,"avatar_url":"https://avatars.githubusercontent.com/u/151263?v=3","gravatar_id":"","url":"https://api.github.com/users/CrossEye","html_url":"https://github.com/CrossEye","followers_url":"https://api.github.com/users/CrossEye/followers","following_url":"https://api.github.com/users/CrossEye/following{/other_user}","gists_url":"https://api.github.com/users/CrossEye/gists{/gist_id}","starred_url":"https://api.github.com/users/CrossEye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrossEye/subscriptions","organizations_url":"https://api.github.com/users/CrossEye/orgs","repos_url":"https://api.github.com/users/CrossEye/repos","events_url":"https://api.github.com/users/CrossEye/events{/privacy}","received_events_url":"https://api.github.com/users/CrossEye/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T19:46:47Z","updated_at":"2015-10-26T19:46:47Z","body":"I guess I'm just dense.  I simply don't see why this doesn't make it a Functor:\r\n\r\n```haskell\r\ndata Object a = Object (Data.Map String a)\r\n\r\ninstance Functor Object where\r\n  fmap f o = fromList (map modifiy (toList o))\r\n      where modify (s, v) = (s, f v)\r\n```\r\n\r\nI don't see how this prohibits a `filter` function from actually _using_ both `s` and `v`, but perhaps that's where the rubber meets the road.\r\n\r\nStill, this is not a language I speak fluently.  And I can't get anyone to respond to my questions about whether it seems correct to model an Object as a collection of key-value pairs.  So I don't know if we're even close to coming together or headed in entirely different directions."}}