4 ms·
If Rust had algebraic effects, your example would be: fn foo<T,E>(closure: impl FnMut(&T) -> bool | E) -> Option<T> | E All that's needed syntax-wise would
by u320 4y ago
If Rust had algebraic effects, your example would be:
fn foo<T,E>(closure: impl FnMut(&T) -> bool | E) -> Option<T> | E
All that's needed syntax-wise would be a way to attach one or more type parameters to a function type. (I used "|" here but it could be anything)