{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/4437","labels_url":"https://api.github.com/repos/scala/scala/issues/4437/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/4437/comments","events_url":"https://api.github.com/repos/scala/scala/issues/4437/events","html_url":"https://github.com/scala/scala/pull/4437","id":67078324,"number":4437,"title":"SI-8394 Add zip method to Option.","user":{"login":"kubudi","id":880819,"avatar_url":"https://avatars.githubusercontent.com/u/880819?v=3","gravatar_id":"","url":"https://api.github.com/users/kubudi","html_url":"https://github.com/kubudi","followers_url":"https://api.github.com/users/kubudi/followers","following_url":"https://api.github.com/users/kubudi/following{/other_user}","gists_url":"https://api.github.com/users/kubudi/gists{/gist_id}","starred_url":"https://api.github.com/users/kubudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubudi/subscriptions","organizations_url":"https://api.github.com/users/kubudi/orgs","repos_url":"https://api.github.com/users/kubudi/repos","events_url":"https://api.github.com/users/kubudi/events{/privacy}","received_events_url":"https://api.github.com/users/kubudi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scala/scala/labels/welcome","name":"welcome","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"SethTisue","id":161079,"avatar_url":"https://avatars.githubusercontent.com/u/161079?v=3","gravatar_id":"","url":"https://api.github.com/users/SethTisue","html_url":"https://github.com/SethTisue","followers_url":"https://api.github.com/users/SethTisue/followers","following_url":"https://api.github.com/users/SethTisue/following{/other_user}","gists_url":"https://api.github.com/users/SethTisue/gists{/gist_id}","starred_url":"https://api.github.com/users/SethTisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethTisue/subscriptions","organizations_url":"https://api.github.com/users/SethTisue/orgs","repos_url":"https://api.github.com/users/SethTisue/repos","events_url":"https://api.github.com/users/SethTisue/events{/privacy}","received_events_url":"https://api.github.com/users/SethTisue/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/39","html_url":"https://github.com/scala/scala/milestones/2.12.0-M2","labels_url":"https://api.github.com/repos/scala/scala/milestones/39/labels","id":639715,"number":39,"title":"2.12.0-M2","description":"Merge to 2.12.x\r\n\r\n  - [X] minimal nullness analysis for optimizer\r\n  - [X] compile on java 8 (keep testing java6 backend)\r\n  - [ ] build modules for 2.12 on Java 8 (@SethTisue)\r\n  - [ ] put JFunction in library under scala.runtime (SAM target for LMF calls emitted by indylambda) @retronym\r\n  - [ ] enable delambdafy, \r\n  - [ ] indylambda \r\n  - [ ] & genbcode by default\r\n  - [ ] closure inlining\r\n  - [ ] additional closure-specific heuristics for inliner\r\n  - [ ] enable SAM by default, improve wildcard inference, spec [optional]\r\n  - [ ] stabilize community build (find subset for indylambda work)\r\n  - [ ] intermediate implementation of SIP 23 [optional]\r\n  - [ ] detuplify patmat optimization [optional]\r\n  - [ ] remove forkjoin [optional]\r\n  - [ ] sbt build [optional]\r\n","creator":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":15,"state":"open","created_at":"2014-04-24T21:42:13Z","updated_at":"2015-06-09T21:09:12Z","due_on":"2015-06-28T22:00:00Z","closed_at":null},"comments":18,"created_at":"2015-04-08T08:37:01Z","updated_at":"2015-06-11T23:46:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4437","html_url":"https://github.com/scala/scala/pull/4437","diff_url":"https://github.com/scala/scala/pull/4437.diff","patch_url":"https://github.com/scala/scala/pull/4437.patch"},"body":"SI-8394 Option zip should return Option\r\n\r\nIt looks like duplicate implementation for zip methond in IterableLike. \r\nBut based on the note that I found in source code, I think it's feasible considering the outcome.\r\n\r\n@note Many of the methods in here are duplicative with those\r\nin the Traversable hierarchy, but they are duplicated for a reason:\r\nthe implicit conversion tends to leave one with an Iterable in\r\nsituations where one could have retained an Option.\r\nBehavior\r\n\r\n> val some = Some(\"text\")\r\n> val none = None\r\n> val list0 = List()\r\n> val list1 = List(\"text\")\r\n> val list2 = List(\"text\", \"text2\")\r\nOption values with each other:\r\n\r\n> some zip some\r\nres6: Option[(String, String)] = Some((text,text))\r\n\r\n> some zip none\r\nres7: Option[(String, Nothing)] = None\r\n\r\n> none zip some\r\nres8: Option[(Nothing, String)] = None\r\nOption values with other Iterables:\r\n\r\n> some zip list0\r\nres9: Option[(String, Nothing)] = None\r\n\r\n> some zip list1\r\nres10: Option[(String, String)] = Some((text,text))\r\n\r\n> some zip list2\r\nres11: Option[(String, String)] = Some((text,text))\r\n\r\n> none zip list0\r\nres12: Option[(Nothing, Nothing)] = None\r\n\r\n> none zip list1\r\nres13: Option[(Nothing, String)] = None\r\n\r\n> none zip list2\r\nres14: Option[(Nothing, String)] = None\r\nI'm aware there are some comments about that current behaviour is as intended.\r\nThere is even a closed ticket that points the same issue for zipWithIndex. Comment there says:\r\n\r\nZipping with an index is a pretty non-Option-like thing to do (it's equivalent to x.map(y => (y,0)))\r\nBut in my opinion, unlike zipWithIndex, zip might be useful in some cases."},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/111308130","html_url":"https://github.com/scala/scala/pull/4437#issuecomment-111308130","issue_url":"https://api.github.com/repos/scala/scala/issues/4437","id":111308130,"user":{"login":"Ichoran","id":2298644,"avatar_url":"https://avatars.githubusercontent.com/u/2298644?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichoran","html_url":"https://github.com/Ichoran","followers_url":"https://api.github.com/users/Ichoran/followers","following_url":"https://api.github.com/users/Ichoran/following{/other_user}","gists_url":"https://api.github.com/users/Ichoran/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichoran/subscriptions","organizations_url":"https://api.github.com/users/Ichoran/orgs","repos_url":"https://api.github.com/users/Ichoran/repos","events_url":"https://api.github.com/users/Ichoran/events{/privacy}","received_events_url":"https://api.github.com/users/Ichoran/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T23:46:44Z","updated_at":"2015-06-11T23:46:44Z","body":"The docs might stand a little improvement (maybe a bit more than I've commented on, even) but the code and tests LGTM"}}