We would like to know the type of the function composition $f \circ f$. The function in question is typed as follows:
$f :: (\alpha \rightarrow \beta \rightarrow \gamma) \rightarrow (\alpha \times \beta) \rightarrow \gamma$
Is there a systematic way to find out types of function compositions, given the types of the composed functions?
Edit: As I forgot to mention, $\alpha$, $\beta$, $\gamma$ are polymorphic types, hence this composition is actually possible. Haskell says the type definition is as follows: $f \circ f :: (\alpha \rightarrow \beta_1 \rightarrow \beta_2 \rightarrow \gamma) \rightarrow ((\alpha, \beta_1), \beta_2) \rightarrow \gamma$.