Hacker News new | ask | show | jobs
by infogulch 1419 days ago
There one commit referencing my favorite data structure [1], the discriminated union (DU) / tagged union / enums with values:

> kmparser: implement id generator

> That is the first step to implement Unions/Interfaces, it's also useful to know what is the expected message type to decode.

I don't see any other mention or plan about DU's in the repo or metadata. I'm curious what their position is on it.

[1]: https://github.com/inkeliz/karmem/commit/626e6d3b380eb5236c9...

1 comments

I don't even know if it's a proper data structure in the CS sense, but I couldn't agree more with the sentiment. It's a simple concept and together with pattern matching it just makes life so easy it's hard to go back to the alternatives.

Case in point: I used rust for 1-2 years and am now on a project in Go. Even though Go fits my style and my use case better, I miss enums soo much. Both the std lib types like results and option but also the custom ones.