  For every H-space $X$ the set of homotopy classes $[X,X]$ possesses a natural
algebraic structure of a loop near-ring. Albeit one cannot say much about
general loop near-rings, it turns out that those that arise from H-spaces are
sufficiently close to rings to have a viable Krull--Schmidt type decomposition
theory, which is then reflected into decomposition results of H-spaces. In the
paper we develop the algebraic theory of local loop near-rings and derive an
algebraic characterization of indecomposable and strongly indecomposable
H-spaces. As a consequence, we obtain unique decomposition theorems for
products of H-spaces. In particular, we are able to treat certain infinite
products of H-spaces, thanks to a recent breakthrough in the Krull--Schmidt
theory for infinite products. Finally, we show that indecomposable finite
$p$-local H-spaces are automatically strongly indecomposable, which leads to an
easy alternative proof of classical unique decomposition theorems of Wilkerson
and Gray.
