{"action":"created","issue":{"url":"https://api.github.com/repos/nlkl/Optional/issues/52","repository_url":"https://api.github.com/repos/nlkl/Optional","labels_url":"https://api.github.com/repos/nlkl/Optional/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/nlkl/Optional/issues/52/comments","events_url":"https://api.github.com/repos/nlkl/Optional/issues/52/events","html_url":"https://github.com/nlkl/Optional/pull/52","id":305386318,"number":52,"title":"Added more convenient way to construct a None option without having to …","user":{"login":"EamonHetherton","id":449015,"avatar_url":"https://avatars3.githubusercontent.com/u/449015?v=4","gravatar_id":"","url":"https://api.github.com/users/EamonHetherton","html_url":"https://github.com/EamonHetherton","followers_url":"https://api.github.com/users/EamonHetherton/followers","following_url":"https://api.github.com/users/EamonHetherton/following{/other_user}","gists_url":"https://api.github.com/users/EamonHetherton/gists{/gist_id}","starred_url":"https://api.github.com/users/EamonHetherton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EamonHetherton/subscriptions","organizations_url":"https://api.github.com/users/EamonHetherton/orgs","repos_url":"https://api.github.com/users/EamonHetherton/repos","events_url":"https://api.github.com/users/EamonHetherton/events{/privacy}","received_events_url":"https://api.github.com/users/EamonHetherton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-15T01:40:19Z","updated_at":"2018-03-15T20:07:03Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/nlkl/Optional/pulls/52","html_url":"https://github.com/nlkl/Optional/pull/52","diff_url":"https://github.com/nlkl/Optional/pull/52.diff","patch_url":"https://github.com/nlkl/Optional/pull/52.patch"},"body":"…declare the enclosed type where the compiler can determine it."},"comment":{"url":"https://api.github.com/repos/nlkl/Optional/issues/comments/373506218","html_url":"https://github.com/nlkl/Optional/pull/52#issuecomment-373506218","issue_url":"https://api.github.com/repos/nlkl/Optional/issues/52","id":373506218,"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":"2018-03-15T20:07:03Z","updated_at":"2018-03-15T20:07:03Z","author_association":"OWNER","body":"Hi!\r\n\r\nThank you for the PR and your interest in the project.\r\n\r\nActually, adding this functionality is something I have considered multiple times, yet decided against as it always felt a bit messy. Even so, this is definitely one of the better implementations I have seen, so thumbs up for that!\r\n\r\nAnyway, since C# 7.1, similar functionality is already available, as you can use the default keyword without specifying a type:\r\n\r\n```csharp\r\npublic static Option<Order> GetOrder(int orderId)\r\n{\r\n    // ...\r\n\r\n    return default;\r\n}\r\n```\r\n\r\nTechnically, this has the same advantages (concise notation, with types automatically inferred), fewer caveats (it doesn't have a type of its own, so you cannot have an \"NoneOption\" floating around, if you forget to cast it), and has the added bonus of being usable for default argument values in methods.\r\n\r\nOptional \"guarantees\" that `default(Option<T>)` (and `default`) translate to `Option.None<T>()`, so it is an officially supported way to use the default keyword.\r\n\r\nThe downside, unfortunately, is that `default` isn't a great name, and might be less obvious than `return Option.None`, but I think that is an acceptable compromise.\r\n\r\nAny thoughts - would using `default` be acceptable on your side?\r\n\r\nBest regards,\r\n/ Nils"}}
{"actor":{"display_login":"nlkl"}}