export more functions in TypeInference.Ctx;
index retrieval functions take an optional substitution