Many quadrature schemes are defined by the degree of polynomials for which they are exact. For example, we say that the rule $\sum_i a_i f(x_i)$ is order $n$ when $\sum_i a_i p(x_i) = \int p(x) dx$ for all polynomials $p$ of degree $\leq n$.
My question is whether or not there is some body of known results and techniques for deriving quadrature rules that are exact for some arbitrary set of functions. Mainly, I'm thinking about how to derive rules that are exact for all polynomials of degree $\leq n$ and exact for a few other given functions $f(t)$, $g(t)$, and $h(t)$, say.
I would guess that one could optimally use $m$ points and be of order $2m-k$ and also exact for $k$ functions generically, but I haven't the faintest clue if someone has already worked out how one derives such rules or whether such rules have a name.