Abstract
Type error messages for ML-based languages tend to suffer from imprecise error locations – the type checker reports only one of many possible locations of an error. The notion of a type error slice corrects this by reporting all program locations that contribute to a given error (and no more).
Previous work on producing type error slices required the use of a constraint-based type checker implementation. For most existing systems this would require substantial changes to well-tested and subtle pieces of code. In this work we show how to produce useful type error slices with an unmodified type checker. Other tools, such as automatic correction systems, can be layered on top of our system.
We have implemented this technique on top of the Glasgow Haskell Compiler (GHC) and report our experiences.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Damas, L., Milner, R.: Principal type-schemes for functional programs. In: POPL 1982: Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 207–212. ACM (1982)
Haack, C., Wells, J.B.: Type Error Slicing in Implicitly Typed Higher-Order Languages. In: Degano, P. (ed.) ESOP 2003. LNCS, vol. 2618, pp. 284–301. Springer, Heidelberg (2003)
Hage, J., Heeren, B.: Heuristics for Type Error Discovery and Recovery. In: Horváth, Z., Zsók, V., Butterfield, A. (eds.) IFL 2006. LNCS, vol. 4449, pp. 199–216. Springer, Heidelberg (2007)
Heeren, B.J.: Top Quality Type Error Messages. Ph.D. thesis, Universiteit Utrecht (2005)
Lerner, B.S., Flower, M., Grossman, D., Chambers, C.: Searching for Type-Error Messages. In: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design & Implementation, PLDI 2007, pp. 425–434. ACM (2007)
Lerner, B.S., Grossman, D., Chambers, C.: Seminal: Searching for ML Type-Error Messages. In: Proceedings of the 2006 ACM SIGPLAN Workshop on ML 2006, pp. 63–73. ACM (2006)
Milner, R.: A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences 17, 348–375 (1978)
Pottier, F., Rémy, D.: The Essence of ML Type Inference. In: Pierce, B. (ed.) Advanced Topics in Types and Programming Languages, ch. 10, The MIT Press (2005)
Rahli, V., Wells, J.B., Kamareddine, F.: Challenges of a type error slicer for the SML language. Tech. rep., Heriot-Watt University, Edinburgh, UK (2009)
Schrijvers, T., Peyton Jones, S., Sulzmann, M., Vytiniotis, D.: Complete and Decidable Type Inference for GADTs. In: Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, ICFP 2009, pp. 341–352. ACM (2009)
Stuckey, P.J., Sulzmann, M., Wazny, J.R.: Improving Type Error Diagnosis. In: Proceedings of the 2004 ACM SIGPLAN Workshop on Haskell 2004, pp. 80–91. ACM (2004)
Wazny, J.R.: Type inference and type error diagnosis for Hindley/Milner with extensions. Ph.D. thesis, The University of Melbourne (January 2006)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Schilling, T. (2012). Constraint-Free Type Error Slicing. In: Peña, R., Page, R. (eds) Trends in Functional Programming. TFP 2011. Lecture Notes in Computer Science, vol 7193. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32037-8_1
Download citation
DOI: https://doi.org/10.1007/978-3-642-32037-8_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-32036-1
Online ISBN: 978-3-642-32037-8
eBook Packages: Computer ScienceComputer Science (R0)