Skip to main content

Constraint-Free Type Error Slicing

  • Conference paper
Trends in Functional Programming (TFP 2011)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7193))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. Heeren, B.J.: Top Quality Type Error Messages. Ph.D. thesis, Universiteit Utrecht (2005)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Milner, R.: A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences 17, 348–375 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. Wazny, J.R.: Type inference and type error diagnosis for Hindley/Milner with extensions. Ph.D. thesis, The University of Melbourne (January 2006)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics