2 ms·
> Iterator design is another area where sum types would help simplify things a lot. Just one method returning Some/None would be so much better. It would be be
by masklinn 3y ago
> Iterator design is another area where sum types would help simplify things a lot. Just one method returning Some/None would be so much better.
It would be better, but since go has MRV and zero values
func Next() (hasNext bool, nextValue T)
works fine, this is not Java or C# where you need to split the protocol into two separate operations.