  We study the problem of fairly allocating a set of indivisible goods among
agents with matroid rank valuations -- every good provides a marginal value of
$0$ or $1$ when added to a bundle and valuations are submodular. We generalize
the Yankee Swap algorithm to create a simple framework, called General Yankee
Swap, that can efficiently compute allocations that maximize any justice
criterion (or fairness objective) satisfying some mild assumptions. Along with
maximizing a justice criterion, General Yankee Swap is guaranteed to maximize
utilitarian social welfare, ensure strategyproofness and use at most a
quadratic number of valuation queries. We show how General Yankee Swap can be
used to compute allocations for five different well-studied justice criteria:
(a) Prioritized Lorenz dominance, (b) Maximin fairness, (c) Weighted leximin,
(d) Max weighted Nash welfare, and (e) Max weighted $p$-mean welfare. In
particular, our framework provides the first polynomial time algorithms to
compute weighted leximin, max weighted Nash welfare and max weighted $p$-mean
welfare allocations for agents with matroid rank valuations.
