Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

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)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: