{"action":"created","issue":{"url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/526","repository_url":"https://api.github.com/repos/fsharp/fslang-suggestions","labels_url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/526/comments","events_url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/526/events","html_url":"https://github.com/fsharp/fslang-suggestions/issues/526","id":196600265,"number":526,"title":"Add an either function to the Option and Result module","user":{"login":"rexcfnghk","id":2632364,"avatar_url":"https://avatars1.githubusercontent.com/u/2632364?v=4","gravatar_id":"","url":"https://api.github.com/users/rexcfnghk","html_url":"https://github.com/rexcfnghk","followers_url":"https://api.github.com/users/rexcfnghk/followers","following_url":"https://api.github.com/users/rexcfnghk/following{/other_user}","gists_url":"https://api.github.com/users/rexcfnghk/gists{/gist_id}","starred_url":"https://api.github.com/users/rexcfnghk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rexcfnghk/subscriptions","organizations_url":"https://api.github.com/users/rexcfnghk/orgs","repos_url":"https://api.github.com/users/rexcfnghk/repos","events_url":"https://api.github.com/users/rexcfnghk/events{/privacy}","received_events_url":"https://api.github.com/users/rexcfnghk/received_events","type":"User","site_admin":false},"labels":[{"id":471343983,"url":"https://api.github.com/repos/fsharp/fslang-suggestions/labels/area:%20library","name":"area: library","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-20T06:57:56Z","updated_at":"2018-05-29T22:35:37Z","closed_at":null,"author_association":"NONE","body":"# Title of Suggestion\r\n\r\nI propose we add an `either` function to the `Option` and `Result` module.\r\n\r\nThe existing way of approaching this problem in F# is to define it ourselves:\r\n\r\n```f#\r\nmodule Option\r\n    let either some none = function\r\n        | Some x -> some x\r\n        | None -> none\r\n\r\nmodule Result\r\n    let either ok error = function\r\n        | Ok x -> ok x\r\n        | Error e -> error e\r\n```\r\n\r\n## Pros and Cons \r\n\r\nThe advantages of making this adjustment to F# are\r\n\r\n- It is a typical usage of `Option` and `Result` to perform branching when the result is considered 'valid' (e.g. `Some x`/`Ok x`)\r\n\r\nThe disadvantages of making this adjustment to F# are\r\n\r\n- Extra API on both modules\r\n- Extra tests needed\r\n\r\n## Extra information\r\n\r\nEstimated cost (XS, S, M, L, XL, XXL): XS\r\n\r\nRelated suggestions: (put links to related suggestions here)\r\n\r\n## Affadavit (must be submitted)\r\n\r\nPlease tick this by placing a cross in the box:\r\n* [x] This is not a question (e.g. like one you might ask on [stackoverflow](http://stackoverflow.com)) and I have searched stackoverflow for discussions of this issue\r\n* [x] I have [searched both open and closed suggestions on this site](http://github.com/fsharp/fslang-suggestions/issues) and believe this is not a duplicate\r\n* [x] This is not something which has obviously \"already been decided\" in previous versions of F#.  If you're questioning a fundamental design decision that has obviously already been taken (e.g. \"Make F# untyped\") then please don't submit it.\r\n\r\nPlease tick all that apply:\r\n* [x] This is not a breaking change to the F# language design\r\n* [x] I would be willing to help implement and/or test this\r\n* [ ] I or my company would be willing to help crowdfund F# Software Foundation members to work on this\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/comments/392969912","html_url":"https://github.com/fsharp/fslang-suggestions/issues/526#issuecomment-392969912","issue_url":"https://api.github.com/repos/fsharp/fslang-suggestions/issues/526","id":392969912,"user":{"login":"dsyme","id":7204669,"avatar_url":"https://avatars1.githubusercontent.com/u/7204669?v=4","gravatar_id":"","url":"https://api.github.com/users/dsyme","html_url":"https://github.com/dsyme","followers_url":"https://api.github.com/users/dsyme/followers","following_url":"https://api.github.com/users/dsyme/following{/other_user}","gists_url":"https://api.github.com/users/dsyme/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyme/subscriptions","organizations_url":"https://api.github.com/users/dsyme/orgs","repos_url":"https://api.github.com/users/dsyme/repos","events_url":"https://api.github.com/users/dsyme/events{/privacy}","received_events_url":"https://api.github.com/users/dsyme/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T22:35:37Z","updated_at":"2018-05-29T22:35:37Z","author_association":"COLLABORATOR","body":"@danielo515 This suggestion hasn't actually been approved, and I don't think we'll be doing it "}}
{"actor":{"display_login":"dsyme"}}