When does Hom functor commutes with direct sum in the second slot

1.5k Views Asked by At

I have seen in a post that there is a basic fact for R-modules and the morphisms: $$\operatorname{Hom}(A,\bigoplus_{i\in I}B_i)\cong \bigoplus_{i\in I}\operatorname{Hom}(A,B_i)$$

I only know that it is true when replacing both direct sums by direct products, which is obvious by the universal property of product. It is also obvious by the property of coproduct that the direct sum of the first slot can be moved outside to be direct product. While this one does not seem to be that obvious.

Does this hold in general? If so, can someone provide an easy proof? I've seen a similar one about group representation but that is rather confusing to me.