  It is shown that the Bellman function method can be applied to study the
$L^p$-norms of general operators on martingales, i.e., of operators that are
not necessarily martingale transforms. Informally, we provide a single
Bellman-type function that "encodes" the $L^p$-boundedness of "almost all"
operators from Gundy's extrapolation theorem. As examples of such operators, we
consider the Haar transforms and the operator whose $L^p$-boundedness underlies
Rubio de Francia's inequality for the Walsh system.
