School of Computing

Compositional explanation of types and algorithmic debugging of type errors

Olaf Chitil

In Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP'01), pages 182-196, Firenze, Italy, September 2001. ACM.

Abstract

The type systems of most typed functional programming languages are based on the Hindley-Milner type system. A practical problem with these type systems is that it is often hard to understand why a program is not type correct or a function does not have the intended type. We suggest that at the core of this problem is the difficulty of explaining why a given expression has a certain type. The type system is not defined compositionally. We propose to explain types using a variant of the Hindley-Milner type system that defines a compositional type explanation graph of principal typings. We describe how the programmer understands types by interactive navigation through the explanation graph. Furthermore, the explanation graph can be the foundation for algorithmic debugging of type errors, that is, semi-automatic localisation of the source of a type error without even having to understand the type inference steps. We implemented a prototype of a tool to explore the usefulness of the proposed methods.

Download publication 184 kbytes (PDF)

Bibtex Record

@inproceedings{1811,
author = {Olaf Chitil},
title = {Compositional Explanation of Types and Algorithmic Debugging of Type Errors},
month = {September},
year = {2001},
pages = {182-196},
keywords = {determinacy analysis, Craig interpolants},
note = {},
doi = {},
url = {http://www.cs.kent.ac.uk/pubs/2001/1811},
    publication_type = {inproceedings},
    submission_id = {15958_1077221965},
    booktitle = {Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP'01)
},
    address = {Firenze, Italy},
    publisher = {ACM},
    refereed = {yes},
    ISBN = {1-58113-415-0},
}

School of Computing, University of Kent, Canterbury, Kent, CT2 7NF

Enquiries: +44 (0)1227 824180 or contact us.

Last Updated: 21/03/2014