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

Interactive type debugging in Haskell

Published:28 August 2003Publication History

ABSTRACT

In this paper we illustrate the facilities for type debugging of Haskell programs in the Chameleon programming environment. Chameleon provides an extension to Haskell supporting advanced and programmable type extensions. Chameleon maps the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to find minimal justifications of type errors, and to explain unexpected types that arise. Through an interactive process akin to declarative debugging, a user can track down exactly where a type error occurs. The approach handles Hindley/Milner types with Haskell-style overloading. The Chameleon system provides a full implementation of our flexible type debugging scheme which can be used as a front-end to any existing Haskell system.

References

  1. S. Abdennadher. Operational semantics and confluence of constraint propagation rules. In Proc. of CP'97, volume 1330 of LNCS, pages 252--266. Springer-Verlag, 1997.Google ScholarGoogle Scholar
  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 Proc. of ICFP'01, pages 193--204. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Demoen, M. Garcia de la Banda, and P. J. Stuckey. Type constraint solving for parametric and ad-hoc polymorphism. In Proc. of the 22nd Australian Computer Science Conference, pages 217--228. Springer-Verlag, 1999.Google ScholarGoogle Scholar
  5. D. Duggan and F. Bent. Explaining type inference. Science of Computer Programming, 27(1):37--83, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. Fruhwirth. Constraint handling rules. In Constraint Programming: Basics and Trends, volume 910 of LNCS. Springer-Verlag, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Garcia de la Banda, P.J. Stuckey, and J. Wazny. Finding all minimal unsatisfiable constraints. In Proc. of PPDP'03. ACM Press, 2003. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. K. Glynn, P. J. Stuckey, and M. Sulzmann. Type classes and constraint handling rules. In Workshop on Rule-Based Constraint Reasoning and Programming, 2000. http://xxx.lanl.gov/abs/cs.PL/0006034.Google ScholarGoogle Scholar
  9. C. Haack and J. B. Wells. Type error slicing in implicitly typed, higher-order languages. In Proc. of ESOP'03, volume 2618 of LNCS, pages 284--301. Springer-Verlag, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Haskell 98 language report. http://research.microsoft.com/Users/simonpj/haskell98-revised/haskell98-report-html/.Google ScholarGoogle Scholar
  11. B. Heeren and J. Hage. Parametric type inferencing for Helium. Technical Report UU-CS-2002-035, Utrecht University, 2002.Google ScholarGoogle Scholar
  12. B. Heeren, J. Hage, and D. Swierstra. Generalizing Hindley-Milner type inference algorithms. Technical Report UU-CS-2002-031, Utrecht University, 2002.Google ScholarGoogle Scholar
  13. Helium home page. http://www.cs.uu.nl/~afie/helium/.Google ScholarGoogle Scholar
  14. F. Huch, O. Chitil, and A. Simon. Typeview: a tool for understanding type errors. In M. Mohnen and P. Koopman, editors, Proceedings of 12th International Workshop on Implementation of Functional Languages, pages 63--69. Aachner Informatik-Berichte,, 2000.Google ScholarGoogle Scholar
  15. Hugs home page. haskell.org/hugs/.Google ScholarGoogle Scholar
  16. M. P. Jones. Coherence for qualified types. Research Report YALEU/DCS/RR-989, Yale University, Department of Computer Science, September 1993.Google ScholarGoogle Scholar
  17. O. Lee and K. Yi. A generalized let-polymorphic type inference algorithm. Technical Memorandum ROPAS-2000-5, National Creative Research Center, Korea Advanced Institute of Science and Technology, March 2000.Google ScholarGoogle Scholar
  18. K. Marriott and P.J. Stuckey. Programming with Constraints: an Introduction. MIT Press, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  19. B.J. McAdam. Graphs for recording type information. Technical Report ECS-LFCS-99-415, The University of Edinburgh, 1999.Google ScholarGoogle Scholar
  20. B.J. McAdam. Generalising techniques for type debugging. In Trends in Functional Programming, pages 49--57, March 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348--375, Dec 1978.Google ScholarGoogle ScholarCross RefCross Ref
  22. M. Odersky, M. Sulzmann, and M~Wehr. Type inference with constrained types. Theory and Practice of Object Systems, 5(1):35--55, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. E. Shapiro. Algorithmic Program Debugging. MIT Press, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. J. Stuckey and M. Sulzmann. A theory of overloading. In Proc. of ICFP'02, pages 167--178. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Sulzmann. A General Framework for Hindley/Milner Type Systems with Constraints. PhD thesis, Yale University, Department of Computer Science, May 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Sulzmann and J. Wazny. Chameleon. http://www.comp.nus.edu.sg/~sulzmann/chameleon.Google ScholarGoogle Scholar
  27. P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In Proc. of POPL'89, pages 60--76. ACM Press, 1989. Google ScholarGoogle Scholar
  28. M. Wand. Finding the source of type errors. In Proc. of POPL'86, pages 38--43. ACM Press, 1986. Google ScholarGoogle Scholar
  29. J. Yang, J. Wells, P. Trinder, and G. Michaelson. Improved type error reporting. In Proceedings of 12th International Workshop on Implementation of Functional Languages, pages 71--86, 2000.Google ScholarGoogle Scholar

Index Terms

  1. Interactive type debugging in Haskell

          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
            Haskell '03: Proceedings of the 2003 ACM SIGPLAN workshop on Haskell
            August 2003
            114 pages
            ISBN:1581137583
            DOI:10.1145/871895

            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: 28 August 2003

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            Haskell '03 Paper Acceptance Rate10of30submissions,33%Overall Acceptance Rate57of143submissions,40%

            Upcoming Conference

            ICFP '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader