News for hackers. Stuff that matters.
Re:A rough proposal for sum types in Go (2018) by kadoban on Tuesday November 16, 2021 @07:57AM (#29239967)
> How can you know that half the things I can represent are wrong? There are many situations where both returning a value and not returning a value are both valid. And where errors conditions may not dictate what the returned value should be.

That's why I wrote: Yes there are times when those are valid returns, but easily 99% of the time they're not. The type system should be able to represent both ways.

The golang type system can _already_ encode the case you're talking about, and that should stay. My complaint is that is the _only_ case it can represent, it cannot represent the more common case.

There are no comments on this comment yet.