Skip to main content

Guided Type Debugging

  • Conference paper
Book cover Functional and Logic Programming (FLOPS 2014)

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

Included in the following conference series:

Abstract

We present guided type debugging as a new approach to quickly and reliably remove type errors from functional programs. The method works by generating type-change suggestions that satisfy type specifications that are elicited from programmers during the debugging process. A key innovation is the incorporation of target types into the type error debugging process. Whereas previous approaches have aimed exclusively at the removal of type errors and disregarded the resulting types, guided type debugging exploits user feedback about result types to achieve better type-change suggestions. Our method can also identify and remove errors in type annotations, which has been a problem for previous approaches. To efficiently implement our approach, we systematically generate all potential type changes and arrange them in a lattice structure that can be efficiently traversed when guided by target types that are provided by programmers.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
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. Abraham, R., Erwig, M.: GoalDebug: A Spreadsheet Debugger for End Users. In: 29th IEEE Int. Conf. on Software Engineering, pp. 251–260 (2007)

    Google Scholar 

  2. Bernstein, K.L., Stark, E.W.: Debugging type errors. Technical report, State University of New York at Stony Brook (1995)

    Google Scholar 

  3. Braßel, B.: Typehope: There is hope for your type errors. In: Int. Workshop on Implementation of Functional Languages (2004)

    Google Scholar 

  4. Chen, S., Erwig, M.: Counter-Factual Typing for Debugging Type Errors. In: ACM Symp. on Principles of Programming Languages, pp. 583–594 (2014)

    Google Scholar 

  5. Chen, S., Erwig, M., Walkingshaw, E.: An Error-Tolerant Type System for Variational Lambda Calculus. In: ACM Int. Conf. on Functional Programming, pp. 29–40 (2012)

    Google Scholar 

  6. Chen, S., Erwig, M., Walkingshaw, E.: Extending Type Inference to Variational Programs. ACM Trans. on Programming Languages and Systems 36(1), 1–54 (2014)

    Article  Google Scholar 

  7. Chitil, O.: Compositional explanation of types and algorithmic debugging of type errors. In: ACM Int. Conf. on Functional Programming, pp. 193–204 (September 2001)

    Google Scholar 

  8. Chitil, O., Huch, F., Simon, A.: Typeview: A tool for understanding type errors. In: International Workshop on Implementation of Functional Languages, pp. 63–69 (2000)

    Google Scholar 

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

    Chapter  Google Scholar 

  10. Hage, J.: Helium benchmark programs. Private Communication (2002-2005)

    Google Scholar 

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

  12. Heeren, B.J.: Top Quality Type Error Messages. PhD thesis, Universiteit Utrecht, The Netherlands (September 2005)

    Google Scholar 

  13. Johnson, G.F., Walz, J.A.: A maximum-flow approach to anomaly isolation in unification-based incremental type inference. In: ACM Symp. on Principles of Programming Languages, pp. 44–57 (1986)

    Google Scholar 

  14. Lerner, B., Flower, M., Grossman, D., Chambers, C.: Searching for type-error messages. In: ACM Int. Conf. on Programming Language Design and Implementation, pp. 425–434 (2007)

    Google Scholar 

  15. McAdam, B.J.: Repairing type errors in functional programs. PhD thesis, University of Edinburgh. College of Science and Engineering. School of Informatics (2002)

    Google Scholar 

  16. Neubauer, M., Thiemann, P.: Discriminative sum types locate the source of type errors. In: ACM Int. Conf. on Functional Programming, pp. 15–26 (2003)

    Google Scholar 

  17. Neubauer, M., Thiemann, P.: Haskell type browser. In: ACM SIGPLAN Workshop on Haskell, pp. 92–93 (2004)

    Google Scholar 

  18. Odersky, M., Läufer, K.: Putting type annotations to work. In: ACM Symp. on Principles of Programming Languages, pp. 54–67 (1996)

    Google Scholar 

  19. Schilling, T.: Constraint-free type error slicing. In: Peña, R., Page, R. (eds.) TFP 2011. LNCS, vol. 7193, pp. 1–16. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  20. Stuckey, P.J., Sulzmann, M., Wazny, J.: Interactive Type Debugging in Haskell. In: ACM SIGPLAN Workshop on Haskell, pp. 72–83 (2003)

    Google Scholar 

  21. Stuckey, P.J., Sulzmann, M., Wazny, J.: Improving type error diagnosis. In: ACM SIGPLAN Workshop on Haskell, pp. 80–91 (2004)

    Google Scholar 

  22. Wand, M.: Finding the source of type errors. In: ACM Symp. on Principles of Programming Languages, pp. 38–43 (1986)

    Google Scholar 

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

    Google Scholar 

  24. Yang, J., Michaelson, G., Trinder, P., Wells, J.B.: Improved type error reporting. In: Int. Workshop on Implementation of Functional Languages, pp. 71–86 (2000)

    Google Scholar 

  25. Zhang, D., Myers, A.C.: Toward General Diagnosis of Static Errors. In: ACM Symp. on Principles of Programming Languages, pp. 569–581 (2014)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Chen, S., Erwig, M. (2014). Guided Type Debugging. In: Codish, M., Sumii, E. (eds) Functional and Logic Programming. FLOPS 2014. Lecture Notes in Computer Science, vol 8475. Springer, Cham. https://doi.org/10.1007/978-3-319-07151-0_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07151-0_3

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07150-3

  • Online ISBN: 978-3-319-07151-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics