skip to main content
10.1145/1159876.1159887acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Seminal: searching for ML type-error messages

Published:16 September 2006Publication History

ABSTRACT

We present a new way to generate type-error messages in a polymorphic, implicitly, and strongly typed language (specifically Caml). Our method separates error-message generation from type-checking by taking a fundamentally new approach: we present to programmers small term-level modifications that cause an ill-typed program to become well-typed. This approach aims to improve feedback to programmers with no change to the underlying type-checker nor the compilation of well-typed programs.We have added a prototype implementation of our approach to the Objective Caml system by intercepting type-checker error messages and using the type-checker on candidate changes to see if they succeed. This novel front-end architecture naturally decomposes into (1) enumerating local changes to the abstract syntax tree that may remove type errors, (2) searching for places to try the changes, (3) using the type-checker to evaluate the changes, and (4) ranking the changes and presenting them to the user.

References

  1. David T. Barnard, Gwen Clarke, and Nicolas Duncan. Tree-to-tree correction for document trees. Technical Report 95--372, Department of Computing and Information Science, Queen's University, Kingston, January 1995.Google ScholarGoogle Scholar
  2. Mike Beaven and Ryan Stansifer. Explaining type errors in polymorphic languages. ACM Letters on Programming Languages and Systems, 2(1-4):17--30, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Karen Bernstein and Eugene Stark. Debugging type errors (full version). Technical report, State University of New York at Stony Brook, 1995.Google ScholarGoogle Scholar
  4. Philip Bille. Tree edit distance, alignment distance and inclusion. Technical report, IT University of Copenhagen, April 2003.Google ScholarGoogle Scholar
  5. Olaf Chitil, Frank Huch, and Axel Simon. Typeview: a tool for understanding type errors. In M. Mohnen and P. Koopman, editors, 12th International Workshop on Implementation of Functional Languages, Aachner Informatik-Berichte, pages 63--69, 2000.Google ScholarGoogle Scholar
  6. V. Choppella and C. T. Haynes. Diagnosis of ill-typed programs. Technical Report 426, Indiana University, December 1994.Google ScholarGoogle Scholar
  7. Dominic Duggan. Correct type explanation. In ACM Workshop on ML, pages 49--58, 1998.Google ScholarGoogle Scholar
  8. Dominic Duggan and Frederick Bent. Explaining type inference. Science of Computer Programming, 27(1):37--83, July 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Milind Gandhe, G. Venkatesh, and Amitabha Sanyal. Correcting errors in the Curry system. In 16th Conference on Foundations of Software Technology and Theoretical Computer Science, pages 347--358, London, UK, 1996. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Christian Haack and J. B. Wells. Type error slicing in implicitly typed higher-order languages. Science of Computer Programming, 50(1-3):189--224, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Bastiaan J. Heeren. Top Quality Type Error Messages. PhD thesis, Universiteit Utrecht, The Netherlands, September 2005.Google ScholarGoogle Scholar
  12. Gregory F. Johnson and Janet A. Walz. A maximum-flow approach to anomaly isolation in unification-based incremental type inference. In 13th ACM Symposium on Principles of Programming Languages, pages 44--57, St. Petersburg Beach, Florida, January 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Yang Jun, Greg Michaelson, and Phil Trinder. Explaining polymorphic types. The Computer Journal, 45(4):436--452, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  14. Oukseh Lee and Kwangkeun Yi. Proofs about a folklore let-polymorphic type inference algorithm. ACM Transactions on Programming Languages and Systems, 20(4):707--723, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Bruce J. McAdam. On the unification of substitutions in type inference. In Kevin Hammond, Anthony J.T. Davie, and Chris Clack, editors, Implementation of Functional Languages (IFL~'98), volume 1595 of LNCS, pages 139--154. Springer-Verlag, September 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Bruce J. McAdam. Repairing Type Errors in Functional Programs. PhD thesis, Laboratory for Foundatations of Computer Science, The University of Edinburgh, 2001.Google ScholarGoogle Scholar
  17. B. J. Oommen, K. Zhang, and W. Lee. Numerical similarity and dissimilarity measures between two trees. IEEE Transactions on Computers, 45(12):1426--1434, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Peter J. Stuckey, Martin Sulzmann, and Jeremy Wazny. Interactive type debugging in Haskell. In ACM Workshop on Haskell, pages 72--83, Uppsala, Sweden, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Tip and T. B. Dinesh. A slicing-based approach for locating type errors. ACM Transactions on Software Engineering and Methodology, 10(1):5--55, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Robert A. Wagner and Michael J. Fischer. The string-to-string correction problem. Journal of the ACM, 21(1):168--173, 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Mitchell Wand. Finding the source of type errors. In 13th ACM Symposium on Principles of Programming Languages, pages 38--43, St. Petersburg Beach, Florida, January 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Seminal: searching for ML type-error messages

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ML '06: Proceedings of the 2006 workshop on ML
        September 2006
        102 pages
        ISBN:1595934839
        DOI:10.1145/1159876

        Copyright © 2006 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 16 September 2006

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate6of11submissions,55%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader