TY - GEN
T1 - Heuristics for type error discovery and recovery
AU - Hage, Jurriaan
AU - Heeren, Bastiaan
PY - 2007
Y1 - 2007
N2 - Type error messages that are reported for incorrect functional programs can be difficult to understand. The reason for this is that most type inference algorithms proceed in a mechanical, syntax-directed way, and are unaware of inference techniques used by experts to explain type inconsistencies. We formulate type inference as a constraint problem, and analyze the collected constraints to improve the error messages (and, as a result, programming efficiency). A special data structure, the type graph, is used to detect global properties of a program, and furthermore enables us to uniformly describe a large collection of heuristics which embed expert knowledge in explaining type errors. Some of these also suggest corrections to the programmer. Our work has been fully implemented and is used in practical situations, showing that it scales up well. We include a number of statistics from actual use of the compiler showing us the frequency with which heuristics are used, and the kind and number of suggested corrections.
AB - Type error messages that are reported for incorrect functional programs can be difficult to understand. The reason for this is that most type inference algorithms proceed in a mechanical, syntax-directed way, and are unaware of inference techniques used by experts to explain type inconsistencies. We formulate type inference as a constraint problem, and analyze the collected constraints to improve the error messages (and, as a result, programming efficiency). A special data structure, the type graph, is used to detect global properties of a program, and furthermore enables us to uniformly describe a large collection of heuristics which embed expert knowledge in explaining type errors. Some of these also suggest corrections to the programmer. Our work has been fully implemented and is used in practical situations, showing that it scales up well. We include a number of statistics from actual use of the compiler showing us the frequency with which heuristics are used, and the kind and number of suggested corrections.
U2 - 10.1007/978-3-540-74130-5_12
DO - 10.1007/978-3-540-74130-5_12
M3 - Conference contribution
SN - 9783540741299
T3 - Lecture Notes in Computer Science
SP - 199
EP - 216
BT - Implementation and Application of Functional Languages. IFL 2006
A2 - Horváth, Z.
A2 - Zsók, V.
A2 - Butterfield, A.
PB - Springer
ER -