In limited sense it is very easy to write out
and ref
classes on your own, but my question is not how to do it -- but are there some features (or classes) ready to use?
The closest thing I found is Reference
trait (but it is a trait).
I need those, not tuple, not Option, and not Either as pure result, because only ref/out makes chaining ifs elegant.