4 ms·
I don't think you're getting useful optionals without matching.
by tptacek 2y ago
I don't think you're getting useful optionals without matching.
- vineyardmike 2y agoI’d take Java-style optionals but yea matching would be welcome to me.
- DylanSp 2y agoThere are type switch statements, at least, and libraries like https://github.com/phelmkamp/valor https://github.com/phelmkamp/valor can use them to provide more concise abstractions. The really frustrating thing is that interfaces can't have methods that introduce new type parameters, so we're stuck with standalone functions like `optional.Map(optionalFoo, barFunc)` instead of `optionalFoo.map(barFunc)`>