/// A trimmed-down version of the `std::Iterator` trait.
pub trait effect Iterator {
type Item;
effect fn next(&mut self) -> Option<Self::Item>;
fn size_hint(&self) -> (usize, Option<usize>);
}
Notes
This is just a postfix version of the originally proposed syntax.
This should appear more familiar, as the question mark is normally used at the end of a
sentence, not at the beginning, and it looks similar to typescripts nullable types.
it also makes generic references more legible &mut? T vs &?mut T.
postfix-question-mark
Design
base (reference)
always async
maybe async
generic over all modifier keywords
Notes
This is just a postfix version of the originally proposed syntax. This should appear more familiar, as the question mark is normally used at the end of a sentence, not at the beginning, and it looks similar to typescripts nullable types. it also makes generic references more legible
&mut? T
vs&?mut T
.