I prefer Kotlin's general approach of .let and similar:
number = foo.bar().baz().let { match it { A => 1 B => 2 } }
[1] https://doc.rust-lang.org/std/option/enum.Option.html#method..., https://doc.rust-lang.org/std/result/enum.Result.html#method..., https://doc.rust-lang.org/std/iter/trait.Iterator.html#metho...
let number = foo.bar().baz().match { it => it + 1 };
I prefer Kotlin's general approach of .let and similar:
Now anyone has the general tool for chaining without needing library authors or language designers to create the API for them.