f(..., State0) -> {A,State1} = foo(..., State0), {B,State2} = bar(..., State1), {C,State3} = baz(..., State2), Res = fubar(A, B, C, ...), {Res,State3}.