It's often possible to find people arguing that an existing prison system is already playing more than one of these roles, which raises questions about how well we understand a system that US society has committed to in a big way.
The results suggest that prison does limit future violent crime by keeping criminals out of the general population, but the experience of prison provides little deterrence for future crime.
A team of social scientists had access to data on everyone who committed a felony in Michigan between 2003 and 2006.
This included follow-up data running through 2015, allowing the scientists to track whether any of this population committed additional crimes.
Michigan provides an interesting opportunity because its judges aren't limited by the state's sentencing guidelines—the guidelines are meant to be advisory, not mandatory.
This allowed the scientists to use a random aspect of the process—the assignment of a judge—as a tool to look at the impact of sentencing on the convicted population.