The formal Darwinism project aims to provide a mathematically rigorous basis for optimisation thinking in relation to natural selection. This paper deals with the situation in which individuals in a population belong to classes, such as sexes, or size and/or age classes. Fisher introduced the concept of reproductive value into biology to help analyse evolutionary processes of populations divided into classes. Here a rigorously defined and very general structure justifies, and shows the unity of concept behind, Fisher's uses of reproductive value as measuring the significance for evolutionary processes of (i) an individual and (ii) a class; (iii) recursively, as calculable for a parent as a sum of its shares in the reproductive values of its offspring; and (iv) as an evolutionary maximand under natural selection. The maximand is the same for all parental classes, and is a weighted sum of offspring numbers, which implies that a tradeoff in one aspect of the phenotype can legitimately be studied separately from other aspects. The Price equation, measure theory, Markov theory and positive operators contribute to the framework, which is then applied to a number of examples, including a new and fully rigorous version of Fisher's sex ratio argument. Classes may be discrete (e.g. sex), continuous (e.g. weight at fledging) or multidimensional with discrete and continuous components (e.g. sex and weight at fledging and adult tarsus length).