This makes me think of linear types, would they help?