imperative types and type inference, with a clean distinction
between universal variables and free variables (using refs)