Now they are exist for Function1 only, but it is useful to have them for any Function, since Tuples are converted to function arguments in Scala 3.
The logic is: if someFunction return type is a some Tuple(T1, T2…) , you can compose it with otherFunction, which has (T1, T2…) arguments with the same types, as returned Tuple from someFunction.
For example, if
val f1: (T1, T2) => (T3, T4, T5) val f2: (T3, T4, T5) => R
f2 compose f1
f1 andThen f2
gives you the function
(x1: T1, x2: T2) => R = f2( f1(x1, x2) )
It has some symmetry with “function-chain call” proposal.