Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mirashii
· 3mo ago · 0 comments
This is only a small piece of the story for what people say when they want tagged unions. Without all of the ancillary support in the language, like exhaustive pattern matching, it really doesn't count.
Comments
[–]
Splizard
3mo ago
You can also add support for exhaustive switches on tags.
[–]
catlifeonmars
3mo ago
Just as a linter config though?
[–]
Splizard
3mo ago
No, by leveraging unkeyed struct initializers as the switch case pattern, which the Go compiler does exhaustiveness checking on.