{"action":"created","issue":{"url":"https://api.github.com/repos/nlkl/Optional/issues/30","repository_url":"https://api.github.com/repos/nlkl/Optional","labels_url":"https://api.github.com/repos/nlkl/Optional/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/nlkl/Optional/issues/30/comments","events_url":"https://api.github.com/repos/nlkl/Optional/issues/30/events","html_url":"https://github.com/nlkl/Optional/issues/30","id":249357944,"number":30,"title":"IEnumerable<Option<T>>.Flatten() to remove Nones from collection of Option<T> (and unwrap Somes)","user":{"login":"voxoid0","id":4857269,"avatar_url":"https://avatars2.githubusercontent.com/u/4857269?v=4","gravatar_id":"","url":"https://api.github.com/users/voxoid0","html_url":"https://github.com/voxoid0","followers_url":"https://api.github.com/users/voxoid0/followers","following_url":"https://api.github.com/users/voxoid0/following{/other_user}","gists_url":"https://api.github.com/users/voxoid0/gists{/gist_id}","starred_url":"https://api.github.com/users/voxoid0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voxoid0/subscriptions","organizations_url":"https://api.github.com/users/voxoid0/orgs","repos_url":"https://api.github.com/users/voxoid0/repos","events_url":"https://api.github.com/users/voxoid0/events{/privacy}","received_events_url":"https://api.github.com/users/voxoid0/received_events","type":"User","site_admin":false},"labels":[{"id":155454817,"url":"https://api.github.com/repos/nlkl/Optional/labels/enhancement","name":"enhancement","color":"0e8a16","default":true}],"state":"closed","locked":false,"assignee":{"login":"nlkl","id":3640356,"avatar_url":"https://avatars3.githubusercontent.com/u/3640356?v=4","gravatar_id":"","url":"https://api.github.com/users/nlkl","html_url":"https://github.com/nlkl","followers_url":"https://api.github.com/users/nlkl/followers","following_url":"https://api.github.com/users/nlkl/following{/other_user}","gists_url":"https://api.github.com/users/nlkl/gists{/gist_id}","starred_url":"https://api.github.com/users/nlkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlkl/subscriptions","organizations_url":"https://api.github.com/users/nlkl/orgs","repos_url":"https://api.github.com/users/nlkl/repos","events_url":"https://api.github.com/users/nlkl/events{/privacy}","received_events_url":"https://api.github.com/users/nlkl/received_events","type":"User","site_admin":false},"assignees":[{"login":"nlkl","id":3640356,"avatar_url":"https://avatars3.githubusercontent.com/u/3640356?v=4","gravatar_id":"","url":"https://api.github.com/users/nlkl","html_url":"https://github.com/nlkl","followers_url":"https://api.github.com/users/nlkl/followers","following_url":"https://api.github.com/users/nlkl/following{/other_user}","gists_url":"https://api.github.com/users/nlkl/gists{/gist_id}","starred_url":"https://api.github.com/users/nlkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlkl/subscriptions","organizations_url":"https://api.github.com/users/nlkl/orgs","repos_url":"https://api.github.com/users/nlkl/repos","events_url":"https://api.github.com/users/nlkl/events{/privacy}","received_events_url":"https://api.github.com/users/nlkl/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/nlkl/Optional/milestones/5","html_url":"https://github.com/nlkl/Optional/milestone/5","labels_url":"https://api.github.com/repos/nlkl/Optional/milestones/5/labels","id":2040419,"number":5,"title":"Optional 4.0.0","description":"","creator":{"login":"nlkl","id":3640356,"avatar_url":"https://avatars3.githubusercontent.com/u/3640356?v=4","gravatar_id":"","url":"https://api.github.com/users/nlkl","html_url":"https://github.com/nlkl","followers_url":"https://api.github.com/users/nlkl/followers","following_url":"https://api.github.com/users/nlkl/following{/other_user}","gists_url":"https://api.github.com/users/nlkl/gists{/gist_id}","starred_url":"https://api.github.com/users/nlkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlkl/subscriptions","organizations_url":"https://api.github.com/users/nlkl/orgs","repos_url":"https://api.github.com/users/nlkl/repos","events_url":"https://api.github.com/users/nlkl/events{/privacy}","received_events_url":"https://api.github.com/users/nlkl/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":6,"state":"open","created_at":"2016-09-30T16:07:23Z","updated_at":"2017-08-23T18:13:24Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-08-10T14:05:45Z","updated_at":"2017-08-23T18:13:24Z","closed_at":"2017-08-23T18:13:24Z","body":"btw thanks for the awesome library!\r\n\r\nBorrowing from scala Option functionality, it would be very convenient/intuitive to have a Flatten() method for a collection of Option<T> that unwraps the values, removing the Nones, as in this extension method (another name is fine with me too...Unwrap?):\r\n\r\n```\r\n        public static IEnumerable<T> Flatten<T>(this IEnumerable<Option<T>> options)\r\n        {\r\n            return options.SelectMany(o => o.ToEnumerable());\r\n        }\r\n\r\n```\r\nAnd test:\r\n\r\n ```\r\n       [Test]\r\n        public void Flatten_Always_RemovesNonesAndUnwrapsSomes()\r\n        {\r\n            var options = new List<Option<int>>()\r\n            {\r\n                1.Some(),\r\n                Option.None<int>(),\r\n                3.Some(),\r\n                Option.None<int>(),\r\n                Option.None<int>(),\r\n                6.Some()\r\n            };\r\n\r\n            var flattened = options.Flatten();\r\n\r\n            CollectionAssert.AreEqual(new int[] { 1, 3, 6}, flattened);\r\n        }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/nlkl/Optional/issues/comments/324418269","html_url":"https://github.com/nlkl/Optional/issues/30#issuecomment-324418269","issue_url":"https://api.github.com/repos/nlkl/Optional/issues/30","id":324418269,"user":{"login":"nlkl","id":3640356,"avatar_url":"https://avatars3.githubusercontent.com/u/3640356?v=4","gravatar_id":"","url":"https://api.github.com/users/nlkl","html_url":"https://github.com/nlkl","followers_url":"https://api.github.com/users/nlkl/followers","following_url":"https://api.github.com/users/nlkl/following{/other_user}","gists_url":"https://api.github.com/users/nlkl/gists{/gist_id}","starred_url":"https://api.github.com/users/nlkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlkl/subscriptions","organizations_url":"https://api.github.com/users/nlkl/orgs","repos_url":"https://api.github.com/users/nlkl/repos","events_url":"https://api.github.com/users/nlkl/events{/privacy}","received_events_url":"https://api.github.com/users/nlkl/received_events","type":"User","site_admin":false},"created_at":"2017-08-23T18:13:24Z","updated_at":"2017-08-23T18:13:24Z","body":"Implemented by 56251c89db989d4802e9163557e4c45806bd75fc"}}
{"actor":{"display_login":"nlkl"}}