Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Vertical bar before discriminated unions #13781

Closed
ErikCupal opened this issue Jan 31, 2017 · 2 comments
Closed

Proposal: Vertical bar before discriminated unions #13781

ErikCupal opened this issue Jan 31, 2017 · 2 comments

Comments

@ErikCupal
Copy link

If we want to align discriminated unions vertically, we can write them like this

type Action =
    Increment |
    Decrement |
    Reset

// or

type Action =
    Increment 
    | Decrement 
    | Reset

It doesn't look bad, but it can be quite annoying to check if the bars are at right places when you want to add new types at the beginning or at the end or when you want to reorginize them - basically the same issue as trailing commas.

What I would love to have is this:

type Action =
    | Increment 
    | Decrement 
    | Reset

It is easier to read and easier to maintain.

@ErikCupal ErikCupal changed the title Proposal: Allow vertical bar before discriminated unions Proposal: Vertical bar before discriminated unions Jan 31, 2017
@normalser
Copy link

#12386

@ErikCupal
Copy link
Author

Ah, sorry, I'm closing it

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants