That idea has been doing the rounds since I was a kid (I am 71). The problem with that, as with prisoners doing some productive work, is that the Trade Unions will not allow it.
In Spain prisoners can work, both in prison and sometimes outside. But then that was instituted before Spain became a democracy and the unions took over the asylum !