Skip to main content

A Pattern Logic for Prompt Lazy Assertions in Haskell

  • Conference paper
Implementation and Application of Functional Languages (IFL 2006)

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

Included in the following conference series:

Abstract

Assertions test expected properties of run-time values without disrupting the normal computation of a program. Here we present a library for enriching programs in the lazy language Haskell with assertions. Expected properties are written in an expressive pattern logic that combines pattern matching with logical operations and predicates. The presented assertions are lazy: they do not force evaluation but only examine what is evaluated by other parts of the program. They are also prompt: assertion failure is reported as early as possible, before a faulty value is used by the main computation.

This work has been partially supported by the German Research Council (DFG) under grant Ha 2457/5-2 and by the United Kingdom under EPSRC grant EP/C516605/1.

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. Broberg, N., Farre, A., Svenningsson, J.: Regular expression patterns. In: ICFP 2004: Proceedings of the ninth ACM SIGPLAN international conference on Functional programming, pp. 67–78. ACM Press, New York (2004)

    Chapter  Google Scholar 

  2. Chitil, O., McNeill, D., Runciman, C.: Lazy assertions. In: Trinder, P., Michaelson, G., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 1–19. Springer, Heidelberg (2004)

    Google Scholar 

  3. Claessen, K., Hughes, R.J.M.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Proc. 5th Intl. ACM Conference on Functional Programming, pp. 268–279. ACM Press, New York (2000)

    Google Scholar 

  4. Claessen, K., Runciman, C., Chitil, O., Hughes, J., Wallace, M.: Testing and Tracing Lazy Functional Programs using QuickCheck and Hat. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 59–99. Springer, Heidelberg (2003)

    Google Scholar 

  5. Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: ICFP 2002: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, pp. 48–59. ACM Press, New York (2002)

    Chapter  Google Scholar 

  6. Gill, A.: Debugging Haskell by observing intermediate datastructures. Electronic Notes in Theoretical Computer Science, In: Proc. 2000 ACM SIGPLAN Haskell Workshop. vol. 41(1) (2001)

    Google Scholar 

  7. Hinze, R., Jeuring, J., Löh, A.: Typed contracts for functional programming. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 208–225. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  8. Meyer, B.: Applying design by contract. Computer 25(10), 40–51 (1992)

    Article  Google Scholar 

  9. Meyer, B.: Eiffel: The Language. Prentice-Hall, Inc. Englewood Cliffs (1992)

    MATH  Google Scholar 

  10. Mohnen, M.: Context patterns, part II. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 338–357. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  11. Parnas, D.L.: A technique for software module specification with examples. Commun. ACM 15(5), 330–336 (1972)

    Article  Google Scholar 

  12. Jones, S.P., Gordon, A., Finne, S.: Concurrent Haskell. In: Conference Record of POPL 1996: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 295–308, (January 21–24, 1996)

    Google Scholar 

  13. Rosenblum, D.S.: A practical approach to programming with assertions. IEEE Trans. Softw. Eng. 21(1), 19–31 (1995)

    Article  Google Scholar 

  14. Sheard, T., Jones, S.P.: Template metaprogramming for haskell. In: Haskell Workshop 2002 (October 2002)

    Google Scholar 

  15. Swierstra, Alcocer,: Fast, error correcting parser combinators: A short tutorial. In: Bartosek, M., Tel, G., Pavelka, J. (eds.) SOFSEM 1999. LNCS, vol. 1725, Springer, Heidelberg (1999)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Zoltán Horváth Viktória Zsók Andrew Butterfield

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chitil, O., Huch, F. (2007). A Pattern Logic for Prompt Lazy Assertions in Haskell. In: Horváth, Z., Zsók, V., Butterfield, A. (eds) Implementation and Application of Functional Languages. IFL 2006. Lecture Notes in Computer Science, vol 4449. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74130-5_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-74130-5_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-74129-9

  • Online ISBN: 978-3-540-74130-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics