  We give a characterizations of Ramsey ultrafilters on $\mathscr P(\omega)$ in
terms of functions $f:\omega^n\to\omega$ and their ultrafilter extensions. To
do this, we prove that for any partition $\mathcal P$ of $[\omega]^n$ there is
a finite partition~$\mathcal Q$ of $[\omega]^{2n}$ such that any set
$X\subseteq \omega$ that is homogeneous for $\mathcal Q$ is a finite union of
sets that are canonical for $\mathcal P$.
