Skip to main content
Kent Academic Repository

Type Debugging with Counter-Factual Type Error Messages Using an Existing Type Checker

Tsushima, Kanae, Chitil, Olaf, Sharrad, Joanna (2020) Type Debugging with Counter-Factual Type Error Messages Using an Existing Type Checker. In: IFL '19: Proceedings of the 31st Symposium on Implementation and Application of Functional Languages. ICPS . ACM, New York, NY, USA ISBN 978-1-4503-7562-7. (doi:10.1145/3412932.3412939) (KAR id:81976)

Abstract

The cause of a type error can be very difficult to find for the Hindley-Milner type system. Consequently many solutions have been proposed, but they are hardly used in practice. Here we propose a new solution that provides counter-factual type error messages; these messages state what types specific subexpressions in a program should have (in contrast to the types they actually have) to remove a type error. Such messages are easy-to-understand, because

programers are already familiar with them. Furthermore, our solution is easy-to-implement, because it reuses an existing type checker as a subroutine. We transform an ill-typed program into a well-typed program with additional λ-bound variables. The types of these λ-bound variables yield actual and counter-factual type information. That type information plus intended types added as type annotations direct the search of the type debugger.

Item Type: Conference or workshop item (Proceeding)
DOI/Identification number: 10.1145/3412932.3412939
Uncontrolled keywords: Hindley-Milner type system, OCaml
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Olaf Chitil
Date Deposited: 03 Jul 2020 11:23 UTC
Last Modified: 05 Nov 2024 12:47 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/81976 (The current URI for this page, for reference purposes)

University of Kent Author Information

  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.