Re:Why Checked Exceptions Failed
by DougBTX on Saturday July 15, 2023 @10:01AM
(#36736834)
This isn’t just a problem with custom types, it affects generic iteration types too. With a next() -> Option<T> method, an Iterator can iterate over any type of element.
[ Parent
| on HN ]
Yeah, but there could be a type T for "any type" additional to union types, basically like TRUE in Boolean logic. (Theoretically you could also have F for "no type", intersection types (AND), negation types (not Foo), and any logical complex of those.)