Diagnosing type errors with class
@article{Zhang2015DiagnosingTE, title={Diagnosing type errors with class}, author={Danfeng Zhang and Andrew C. Myers and Dimitrios Vytiniotis and S. Peyton-jones}, journal={Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation}, year={2015} }
Type inference engines often give terrible error messages, and the more sophisticated the type system the worse the problem. We show that even with the highly expressive type system implemented by the Glasgow Haskell Compiler (GHC)--including type classes, GADTs, and type families--it is possible to identify the most likely source of the type error, rather than the first source that the inference engine trips over. To determine which are the likely error sources, we apply a simple Bayesian…Â
30 Citations
A practical framework for type inference error explanation
- Computer ScienceOOPSLA 2016
- 2016
This work shows how to produce correcting set-based error reports by leveraging existing type inference implementations, easing the burden of adoption and, as type inference algorithms tend to be efficient in practice, producing error reports of comparable quality to similar error reporting tools orders of magnitude faster.
Learning user friendly type-error messages
- Computer ScienceProc. ACM Program. Lang.
- 2017
L Learnskell is a type error debugger that uses machine learning to help diagnose and deliver high quality error messages, for programs that contain nonstructural errors, and it is found that it scales to large programs.
Skalpel: A constraint-based type error slicer for Standard ML
- Computer ScienceJ. Symb. Comput.
- 2017
Sound, heuristic type annotation inference for Ruby
- Computer ScienceDLS
- 2020
InferDL, a novel Ruby type inference system that infers sound and useful type annotations by incorporating heuristics that guess types, is introduced and believed to represent a promising approach for inferring type annotations in dynamic languages.
Practical SMT-based type error localization
- Computer ScienceICFP 2015
- 2015
A new algorithm is presented that efficiently finds an optimal error source in a given ill-typed program by using an improved SMT encoding to cope with the high complexity of polymorphic typing by iteratively expanding the typing constraints from which principal types are derived.
Decrypting Local Type Inference
- Computer Science
- 2016
This thesis designs an algorithm that backtracks through the nodes of type derivation trees in order to discover the typing decisions that introduce the types for the first time during the type inference process, and is the first to address the problem of type errors for programming languages that use local type inference.
Context-Dependent Type Error Diagnosis for Functional Languages
- Computer Science
- 2016
This paper shows how within the general framework Constraint Handling Rules the authors can achieve uniformity and generality, while at the same time providing the necessary type error customizability in a natural way, within a Haskell-like language.
SHErrLoc: A Static Holistic Error Locator
- Computer ScienceACM Trans. Program. Lang. Syst.
- 2017
The results show that when compared to existing compilers and other tools, SHErrLoc consistently identifies the location of programmer errors significantly more accurately, without any language-specific heuristics.
Systematic identification and communication of type errors*
- Computer ScienceJournal of Functional Programming
- 2018
Counter-factual typing is developed, which finds a comprehensive set of error causes in AST leaves, computes an informative message on how to get rid of the type error for each error cause, and ranks all messages and iteratively presents the message for the most likely error cause.
References
SHOWING 1-10 OF 44 REFERENCES
Diagnosing Haskell Type Errors
- Computer Science
- 2015
It is shown that even with highly expressive type system implemented by the Glasgow Haskell Compiler—including type classes, GADTs, and type families—it is possible to identify the most likely source of the type error, rather than the first source that the inference engine trips over.
Heuristics for Type Error Discovery and Recovery
- Computer ScienceIFL
- 2006
This work forms type inference as a constraint problem, and analyzes the collected constraints to improve the error messages and, as a result, programming efficiency.
Searching for type-error messages
- Computer SciencePLDI '07
- 2007
This work pursues a new approach to constructing compilers and presenting type-error messages in which the type-checker itself does not produce the messages, and is an oracle for a search procedure that finds similar programs that do type-checking.
Top quality type error Messages
- Computer Science
- 2005
This thesis is entirely devoted to improve the type error messages for a functional programming language, and proposes a set of type inference directives to personalize the type inference process even further.
Toward general diagnosis of static errors
- Computer SciencePOPL 2014
- 2014
A general way to locate programmer mistakes that are detected by static analyses such as type checking, and the results show that the general technique identifies the location of programmer errors significantly more accurately.
Finding Minimum Type Error Sources
- Computer ScienceSoftware Engineering & Management
- 2015
The approach works by reducing the search for minimum error sources to an optimization problem that is formulated in terms of weighted maximum satisfiability modulo theories (MaxSMT), which allows it to build on SMT solvers to support rich type systems and at the same time abstract from the concrete criterion that is used for ranking the error sources.
OutsideIn(X) Modular type inference with local assumptions
- Computer ScienceJournal of Functional Programming
- 2011
This paper characterises the properties of the constraint solver for X so that the resulting algorithm only accepts programs with principal types, even when the type system specification accepts programs that do not enjoy principal types.
Practical type inference for arbitrary-rank types
- Computer ScienceJournal of Functional Programming
- 2007
This paper presents a complete type-inference engine, written in Haskell, for a traditional Damas-Milner type system, and shows how to extend it for higher-rank types.
Counter-factual typing for debugging type errors
- Computer SciencePOPL 2014
- 2014
This work presents an approach to the problem of type debugging that is based on generating and filtering a comprehensive set of type-change suggestions and finds that it outperforms other approaches and provides a viable alternative.
On the unification of substitutions in type inference
- Computer Science
- 1999
A new operation is introduced which allows greater control over the use of substitutions so that this bias can be removed in type inference algorithms so that clearer error messages may then be produced.