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

A lightweight interactive debugger for haskell

Published: 30 September 2007 Publication History

Abstract

This paper describes the design and construction of a Haskell source-level debugger built into the GHCi interactive environment. We have taken a pragmatic approach: the debugger is based on the traditional stop-examine-continue model of online debugging, which is simple and intuitive, but has traditionally been shunned in the context of Haskell because it exposes the lazy evaluation order. We argue that this drawback is not as severe as it may seem, and in some cases is an advantage.
The design focuses on availability: our debugger is intended to work on all programs that can be compiled with GHC, and without requiring the programmer to jump through additional hoops to debug their program. The debugger has a novel approach for reconstructing the type of runtime values in a polymorphic context. Our implementation is light on complexity, and was integrated into GHC without significant upheaval.

References

[1]
K. Angelov and S. Marlow. Visual Haskell: A full-featured Haskell development environment. In Haskell '05: Proceedings of the 2005 ACM SIGPLAN workshop on Haskell, pages 5--16. ACM Press, September 2005.
[2]
F. Baader and W. Snyder. Unification theory. In John Alan Robinson and Andrei Voronkov, editors, Handbook of Automated Reasoning, pages 445--532. Elsevier and MIT Press, 2001. ISBN 0-444-50813-9, 0-262-18223-8.
[3]
T. Brehm. A toolkit for multi-view tracing of Haskell programs. Master's thesis, RWTH Aachen, 2001.
[4]
O. Chitil, C. Runciman, and M. Wallace. Transforming Haskell for tracing. In R. Pena and T. Arts, editors, Implementation of Functional Languages: 14th International Workshop, IFL 2002, volume 2670 of Lecture Notes in Computer Science, pages 165--181. Springer, 2002.
[5]
K. Claessen and J. Hughes. Quickcheck: A lightweight tool for random testing of Haskell programs. In International Conference on Functional Programming, pages 268--279. ACM Press, 2000. L. Damas and R. Milner. Principal type-schemes for functional programs. In POPL '82: Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 207--212, New York, NY, USA, 1982. ACM Press.
[6]
T. Dowd, Z. Somogyi, F. Henderson, T. Conway, and D. Jeffery. Run time type information in Mercury. In PPDP '99: Proceedings of the International Conference PPDP'99 on Principles and Practice of Declarative Programming, pages 224--243, London, UK, 1999. Springer-Verlag.
[7]
R. Ennals and S. Peyton Jones. HsDebug: debugging lazy programs by not being lazy. In Haskell '03: Proceedings of the 2003 ACM SIGPLAN workshop on Haskell, pages 84--87, New York, NY, USA, 2003a. ACM Press.
[8]
R. Ennals and S. Peyton Jones. Optimistic evaluation: an adaptive evaluation strategy for non-strict programs. In ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pages 287--298, New York, NY, USA, 2003b. ACM Press.
[9]
J. Gibbons and K. Wansbrough. Tracing lazy functional languages. In Proceedings of CATS'96: Computing the Australasian Theory Symposium, Melbourne, Australia, January 1996.
[10]
A. Gill. Debugging Haskell by observing intermediate data structures. In Haskell Workshop. ACM SIGPLAN, September 2000.
[11]
A. Gill and C. Runciman. Haskell program coverage. In Haskell Workshop. ACM Press, September 2007.
[12]
D. Goldson. A symbolic calculator for non-strict functional programs. Computer Journal, 37(3):178--187, 1994.
[13]
C. Hall and J. O'Donnell. Debugging in a side effect free programming environment. In Proceedings of the ACM SIGPLAN 85 Symposium on Language Issues in Programming Environments, pages 60--68. ACM Press, 1985.
[14]
D. Herington. HUnit 1.0 user's guide. http://hunit.sourceforge.net/HUnit-1.0/Guide.html, 2002.
[15]
R. Lämmel and S. Peyton Jones. Scrap your boilerplate: a practical design pattern for generic programming. 38(3):26--37, March 2003. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI 2003).
[16]
X. Leroy, D. Rémy D. Doligez, J. Garrigue, and J. Vouillon. The Objective Caml system release 3.10, chapter 16. http://caml.inria.fr/pub/docs/manual-ocaml/manual030.html, 2007.
[17]
I. MacLarty. Practical declarative debugging of Mercury programs. Master's thesis, The University of Melbourne, 2005.
[18]
N. Mitchell and C. Runciman. A static checker for safe pattern matching in Haskell. In Trends in Functional Programming, volume 6. Intellect, 2007.
[19]
L. Naish and T. Barbour. Towards a portable lazy functional declarative debugger. Australian Computer Science Communications, 18(1):401--408, 1996.
[20]
H. Nilsson. Tracing piece by piece: Affordable debugging for lazy functional languages. In Proceedings of the 1999 ACM SIGPLAN International Conference on Functional Programming, pages 36--47. ACM Press, 1999.
[21]
H. Nilsson. How to look busy while being as lazy as ever: The implementation of a lazy functional debugger. Journal of Functional Programming, 11(6):629--671, 2001.
[22]
H. Nilsson. Declarative Debugging for Lazy Functional Languages. PhD thesis, Department of Computer and Information Science, Linköpings universitet, S-581 83, Linköping, Sweden, May 1998.
[23]
W. Partain. The NoFib benchmark suite of Haskell programs. In Proceedings of the 1992 Glasgow Workshop on Functional Programming, pages 195--202, London, UK, 1993. Springer-Verlag.
[24]
B. Pope. A Declarative Debugger for Haskell. PhD thesis, The University of Melbourne, Australia, 2006.
[25]
E. Shapiro. Algorithmic Program Debugging. MIT Press, 1983.
[26]
J. Silva. The Buggy Benchmarks Collection of Haskell Programs. Technical Report DSIC-II/13/07, Universitat Politècnica de Valencia, 2007a. http://www.dsic.upv.es/~jsilva/research.htm#techs.
[27]
J. Silva. A comparative of algorithmic debuggers. In Proc. of VI Jornadas de Programación y Lenguajes (PROLE'07), 2007b. http://www.dsic.upv.es/~jsilva/papers/Prole07.pdf.
[28]
Z. Somogyi and F. Henderson. The implementation technology of the Mercury debugger. Electronic Notes in Theoretical Computer Science, 30(4), 1999.
[29]
J. Sparud. Tracing and Debugging Lazy Functional Computations. PhD thesis, Chalmers University of Technology, Sweden, 1999.
[30]
A. Tolmach and A. Appel. A debugger for standard ML. Journal of Functional Programming, 5(2):155--200, 1995.
[31]
P. Wadler. Why no one uses functional languages. SIGPLAN Notices, 33(8):23--27, 1998.
[32]
M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multiple-View Tracing for Haskell: a New Hat. In Proc. of the 2001 ACM SIGPLAN Haskell Workshop. Universiteit Utrecht UU-CS-2001-23, 2001.
[33]
R. Watson. Tracing Lazy Evaluation by Program Transformation. PhD thesis, Southern Cross University, New South Wales, Australia, 1997.
[34]
S. Weirich. Replib: a library for derivable type classes. In Haskell Workshop, pages 1--12, New York, NY, USA, 2006. ACM Press. ISBN 1-59593-489-8.
[35]
D. Xu. Extended static checking for Haskell. In Haskell '06: Proceedings of the 2006 ACM SIGPLAN workshop on Haskell, pages 48--59. ACM Press, 2006.

Cited By

View all
  • (2020)A Semantic Framework to Debug Parallel Lazy Functional LanguagesMathematics10.3390/math80608648:6(864)Online publication date: 26-May-2020
  • (2020)Building an Integrated Development Environment (IDE) on top of a Build SystemProceedings of the 32nd Symposium on Implementation and Application of Functional Languages10.1145/3462172.3462180(1-10)Online publication date: 2-Sep-2020
  • (2019)Direct Interpretation of Functional Programs for DebuggingElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.294.3294(41-73)Online publication date: 16-May-2019
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Haskell '07: Proceedings of the ACM SIGPLAN workshop on Haskell workshop
September 2007
126 pages
ISBN:9781595936745
DOI:10.1145/1291201
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 September 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. debugging
  2. lazy evaluation

Qualifiers

  • Article

Conference

ICFP07
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2020)A Semantic Framework to Debug Parallel Lazy Functional LanguagesMathematics10.3390/math80608648:6(864)Online publication date: 26-May-2020
  • (2020)Building an Integrated Development Environment (IDE) on top of a Build SystemProceedings of the 32nd Symposium on Implementation and Application of Functional Languages10.1145/3462172.3462180(1-10)Online publication date: 2-Sep-2020
  • (2019)Direct Interpretation of Functional Programs for DebuggingElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.294.3294(41-73)Online publication date: 16-May-2019
  • (2018)Feature-Specific ProfilingACM Transactions on Programming Languages and Systems10.1145/327551941:1(1-34)Online publication date: 19-Dec-2018
  • (2015)Algorithmic debugging of real-world haskell programs: deriving dependencies from the cost centre stackACM SIGPLAN Notices10.1145/2813885.273798550:6(33-42)Online publication date: 3-Jun-2015
  • (2015)Algorithmic debugging of real-world haskell programs: deriving dependencies from the cost centre stackProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2737985(33-42)Online publication date: 3-Jun-2015
  • (2015)Feature-Specific ProfilingCompiler Construction10.1007/978-3-662-46663-6_3(49-68)Online publication date: 2015
  • (2013)Observing SQL queries in their natural habitatACM Transactions on Database Systems10.1145/2445583.244558638:1(1-33)Online publication date: 26-Apr-2013
  • (2011)From stack traces to lazy rewriting sequencesProceedings of the 23rd international conference on Implementation and Application of Functional Languages10.1007/978-3-642-34407-7_7(100-115)Online publication date: 3-Oct-2011
  • (2010)Transformation and debugging of functional logic programsA 25-year perspective on logic programming10.5555/1880413.1880427(271-299)Online publication date: 1-Jan-2010
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media