7 ms·
Ever since I learned of sum types, they have ruined my enjoyment of programming languages which don't have them. I sorely miss them in C++ for example (and std:
by dthul 3y ago
Ever since I learned of sum types, they have ruined my enjoyment of programming languages which don't have them. I sorely miss them in C++ for example (and std::variant is not a worthy alternative).
I don't understand why any new language wouldn't have them.
- koolba 3y agoPedantic typechecking is like learning to spot improper kerning, you think it’s a good thing but you spend your entire life cringing at the world around you.
- valenterry 3y agoJust wait until you learn union types, type classes, type providers, and so on. It's even worse afterwards. :-)
- galkk 3y agostd::variant is a good example of many things bad with c++ improvement process, as a language. If you want to just pattern match on type of visitor there is “another convenience helper” that you need to bring, and result still looks not pleasant. Introduced in like c++17, even in c++23 you still need to write a std::visit to process it. Committee members waste time on yak shaving that std::print