Let $Card$ be the class of infinite cardinals and $p\colon Card^2\to Card$ be given by $(\kappa,\lambda)\mapsto\kappa^\lambda$.
Assuming GCH it is known that $p(\kappa,\lambda)$ is either $\kappa$ (if $\lambda < cof(\kappa)$) or $\kappa^+$ (if $cof(\kappa)≤\lambda ≤\kappa$) or $\lambda^+$ (if $\kappa < \lambda$).
However, knowing less can be enough.
For instance the function $\gimel\colon \kappa\mapsto\kappa^{cof(\kappa)}$ completely determines $p$.
Generalizing from powers to arbitrary products yields the following natural question:
Consider a sequence $(\kappa_i\mid i<\delta)$ of (infinite) cardinals. Can the value $\prod\limits_{i<\delta}\kappa_i$ be de determined knowing (all values of) $\gimel$ or assuming GCH?
One can reformulate the question as: under which circumstances is $\prod\limits_{i<\delta}\kappa_i$ determined by $p$?
EDIT: There is now a solution in the GCH case (see answer below), still curious about general problem.