Efficient unit-checked computation