1 2 3 4 5 6 7 8 9 10 11 12
foo(A, B, C) -> case A of error -> error; ok -> case B of error -> error; {ok, D} -> {ok, {C, D}} end end.