Abstract
This paper presents how to build a type debugger without reimplementing a type inference engine. Previous type debuggers required their own type inference engines apart from the compiler's built-in engine. The advantage of our approach is threefold. First, by not reimplementing it, it is guaranteed that the debugger's type inference never disagree with the compiler's type inference. Secondly, we can avoid the pointless reproduction of a type inference engine that should work precisely as the compiler's type inference engine. Such a reproduction would be a cumbersome and error-prone task for a full-fledged language. Thirdly, our approach is robust to updates of the underlying language. In this article, we will describe how our technique is applied to the simply-typed lambda calculus and let-polymorphism, and report on the prototype type debugger for OCaml.