{"action":"opened","issue":{"url":"https://api.github.com/repos/baronfel/issueTestRepo/issues/34","repository_url":"https://api.github.com/repos/baronfel/issueTestRepo","labels_url":"https://api.github.com/repos/baronfel/issueTestRepo/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/baronfel/issueTestRepo/issues/34/comments","events_url":"https://api.github.com/repos/baronfel/issueTestRepo/issues/34/events","html_url":"https://github.com/baronfel/issueTestRepo/issues/34","id":182962573,"number":34,"title":"Single-use / inline discriminated unions","user":{"login":"baronfel","id":573979,"avatar_url":"https://avatars.githubusercontent.com/u/573979?v=3","gravatar_id":"","url":"https://api.github.com/users/baronfel","html_url":"https://github.com/baronfel","followers_url":"https://api.github.com/users/baronfel/followers","following_url":"https://api.github.com/users/baronfel/following{/other_user}","gists_url":"https://api.github.com/users/baronfel/gists{/gist_id}","starred_url":"https://api.github.com/users/baronfel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baronfel/subscriptions","organizations_url":"https://api.github.com/users/baronfel/orgs","repos_url":"https://api.github.com/users/baronfel/repos","events_url":"https://api.github.com/users/baronfel/events{/privacy}","received_events_url":"https://api.github.com/users/baronfel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/baronfel/issueTestRepo/labels/declined","name":"declined","color":"171819"},{"url":"https://api.github.com/repos/baronfel/issueTestRepo/labels/votes:1-10","name":"votes:1-10","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-14T04:46:09Z","updated_at":"2016-10-14T04:46:09Z","closed_at":null,"body":"# Single-use / inline discriminated unions [11633604] #\n\n**Submitted by Isaac Abraham on 1/29/2016 12:00:00 AM**  \n**8 votes on UserVoice prior to migration**  \n\nI noticed something similar to this in Typescript and it got me thinking - there are occasions when you have a discriminated union that you only want to use as a \"one off\" e.g.\r\ntype WindDirection = N | S | E | W\r\ntype Weather = { WindDirection : WindDirection; IsRaining : bool }\r\nCould this be simplified to something like this: -\r\ntype Weather = { WindDirection : (N | S | E | W); IsRaining : bool }\r\nAlmost like a \"nameless DU\" - similar in a way to active patterns - which might be useful in making code more concise and / or reasoning about.\n\n\n\n## Response ##\n** by fslang-admin on 2/3/2016 12:00:00 AM **\n\nDeclined – see my comment above.\r\nIt’s not a bad idea, but I feel the use of type names is too important in the language to justify the feature (which after all only saves a couple of lines in type definitions, which are themselves rare)\r\nDon Syme, F# Language Evolution\n\n\n**[Original UserVoice Submission](https://fslang.uservoice.com/245727-f-language/suggestions/11633604)**\n[Archived Uservoice Comments](../tree/master/archive/suggestion-11633604-single-use-inline-discriminated-unions.md#comments)\n"}}
{"actor":{"display_login":"baronfel"}}