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

Scripting the type inference process

Published:25 August 2003Publication History

ABSTRACT

To improve the quality of type error messages in functional programming languages,we propose four techniques which influence the behaviour of constraint-based type inference processes. These techniques take the form of externally supplied type inference directives, precluding the need to make any changes to the compiler. A second advantage is that the directives are automatically checked for soundness with respect to the underlying type system. We show how the techniques can be used to improve the type error messages reported for a combinator library. More specifically, how they can help to generate error messages which are conceptually closer to the domain for which the library was developed. The techniques have all been incorporated in the Helium compiler, which implements a large subset of Haskell.

References

  1. A. Aiken and E. Wimmers. Type inclusion constraints and type inference. In Proceedings of Functional Programming Languages and Computer Architecture, pages 31--41, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Beaven and R. Stansifer. Explaining type errors in polymorphic languages. In ACM Letters on Programming Languages, volume 2, pages 17--30, December 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. O. Chitil. Compositional explanation of types and algorithmic debugging of type errors. In Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming, pages 193--204, September 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. L. Damas and R. Milner. Principal type schemes for functional programs. In Principles of Programming Languages, pages 207--212, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Duggan and F. Bent. Explaining type inference. In Science of Computer Programming 27, pages 37--83, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Haack and J. B. Wells. Type error slicing in implicitly typed higher-order languages. In Proceedings of the 12th European Symposium on Programming, pages 284--301, April 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Heeren, J. Hage, and S. D. Swierstra. Generalizing Hindley-Milner type inference algorithms. Technical Report UU-CS-2002-031, Institute of Information and Computing Science, University Utrecht, Netherlands, July 2002.Google ScholarGoogle Scholar
  8. A. van IJzendoorn, D. Leijen, and B. Heeren. The Helium compiler. http://www.cs.uu.nl/helium.Google ScholarGoogle Scholar
  9. J. Yang. Explaining type errors by finding the sources of type conflicts. In G. Michaelson, P. Trindler, and H.-W. Loidl, editors, Trends in Functional Programming, pages 58--66. Intellect Books, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. O. Lee and K. Yi. Proofs about a folklore let-polymorphic type inference algorithm. ACM Transanctions on Programming Languages and Systems, 204):707--723, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. O. Lee and K. Yi. A generalized let-polymorphic type inference algorithm. Technical Memorandum ROPAS-2000-5, Research on Program Analysis System, Korea Advanced Institute of Science and Technology, March 2000.Google ScholarGoogle Scholar
  12. B. J. McAdam. How to repair type errors automatically. In 3rd Scottish Workshop on Functional Programming, pages 121--135. Stirling, U.K., August 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Sulzmann, M. Odersky, and M. Wehr. Type inference with constrained types. Research Report YALEU/DCS/RR-1129, Yale University, Department of Computer Science, April 1997.Google ScholarGoogle Scholar
  14. S. D. Swierstra. Combinator parsers: From toys to tools. In G. Hutton, editor, Electronic Notes in Theoretical Computer Science, volume~41. Elsevier Science Publishers, 2001.Google ScholarGoogle Scholar
  15. J. A. Walz and G. F. Johnson. A maximum flow approach to anomaly isolation in unification-based incremental type inference. In Conference Record of the 13th Annual ACM Symposium on Principles of Programming Languages, pages 44--57, St. Petersburg, FL, January 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Scripting the type inference process

        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
          ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
          August 2003
          310 pages
          ISBN:1581137567
          DOI:10.1145/944705
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 38, Issue 9
            September 2003
            289 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/944746
            Issue’s Table of Contents

          Copyright © 2003 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: 25 August 2003

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          ICFP '03 Paper Acceptance Rate24of95submissions,25%Overall Acceptance Rate333of1,064submissions,31%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader