Skip to main content

Fine Control of Demand in Haskell

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2386))

Abstract

Functional languages have the λ-calculus at their core, but then depart from this firm foundation by including features that alter their default evaluation order. The resulting mixed evaluation—partly lazy and partly strict—complicates the formal semantics of these languages. The functional language Haskell is such a language, with features such as pattern-matching, case expressions with guards, etc., introducing a modicum of strictness into the otherwise lazy language. But just how does Haskell differ from the lazy λ-calculus? We answer this question by introducing a calculational semantics for Haskell that exposes the interaction of its strict features with its default laziness.

The work described here was supported in part by National Science Foundation Grant CDA-9703218 and the M.J. Murdock Charitable Trust.

This is a preview of subscription content, log in via an institution.

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Harold Abelson, Gerald Jay Sussman, and Julie Sussman. Structure and Interpretation of Computer Programs. McGraw Hill, Cambridge, Mass., second edition, 1996.

    MATH  Google Scholar 

  2. Olivier Danvy, Jürgen Koslowski, and Karoline Malmkjær. Compiling monads. Technical Report CIS-92-3, Kansas State University, Manhattan, Kansas, December 1991.

    Google Scholar 

  3. Daniel P. Friedman, Mitchell Wand, and Christopher T. Haynes. Essentials of Programming Languages. McGraw-Hill Book Co., New York, N.Y., second edition, 2001.

    MATH  Google Scholar 

  4. Murdoch Gabbay and Andrew Pitts. A new approach to abstract syntax involving binders. In G. Longo, editor, Proceedings of the 14th Annual Symposium on Logic in Computer Science (LICS’99), pages 214–224, Trento, Italy, July 1999. IEEE Computer Society Press.

    Google Scholar 

  5. Carl A. Gunter. Semantics of Programming Languages: Programming Techniques. The MIT Press, Cambridge, Massachusetts, 1992.

    MATH  Google Scholar 

  6. Cordelia Hall, Kevin Hammond, Simon Peyton Jones, and Phillip Wadler. Type classes in haskell. In Proceedings of the European Symposium on Programming, volume 788 of Lecture Notes in Computer Science, pages 241–256. Springer Verlag, April 1994.

    Google Scholar 

  7. Mark P. Jones. A system of constructor classes: Overloading and implicit higher-order polymorphism. In FPCA’93: Conference on Functional Programming and Computer Architecture, Copenhagen, Denmark, pages 52–61, New York, N.Y., June 1993. ACM Press.

    Google Scholar 

  8. Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Conference record of POPL’95, 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages., pages 333–343. ACM Press, January 1995.

    Google Scholar 

  9. Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). The MIT Press, 1997.

    Google Scholar 

  10. Eugenio Moggi. Functor categories and two-level languages. In Proceedings of the First International Conference on Foundations of Software Science and Computation Structure (FoSSaCS’98), volume 1378 of Lecture Notes in Computer Science, pages 211–223. Springer Verlag, 1998.

    Chapter  Google Scholar 

  11. Simon Peyton Jones. The Implementation of Functional Programming Languages. Computer Science. Prentice-Hall, 1987.

    Google Scholar 

  12. Simon Peyton Jones. Implementing lazy functional languages on stock hardware: The spineless tagless G-machine. Journal of Functional Programming, 2(2):127–202, July 1992.

    Google Scholar 

  13. Simon Peyton Jones and John Hughes (editors). Report on the programming language Haskell 98. February 1999.

    Google Scholar 

  14. Simon Peyton Jones and Simon Marlowe. Secrets of the glasgow haskell compiler inliner. In Proceedings of the Workshop on Implementing Declarative Languages (IDL’99), September 1999.

    Google Scholar 

  15. Simon Peyton Jones and André L. M. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32(1-3):3–47, September 1998.

    Google Scholar 

  16. Andrew Pitts and Murdoch Gabbay. A metalanguage for programming with bound names modulo renaming. In Mathematics of Program Construction, volume 1837 of Lecture Notes in Computer Science, pages 230–255. Springer Verlag, 2000.

    Chapter  Google Scholar 

  17. Rinus Plasmeijer and Marko van Eekelen. Functional programming: Keep it Claen: A unique approach to functional programming. ACM SIGPLAN Notices, 34(6):23–31, June 1999.

    Google Scholar 

  18. Programatica Home Page. http://www.cse.ogi.edu/PacSoft/projects/programatica. James Hook, Principal Investigator.

  19. Joseph E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Semantics. MIT Press, Cambridge, Massachusetts, 1977.

    Google Scholar 

  20. Phillip Wadler. The essence of functional programming. 19th POPL, pages 1–14, January 1992.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Harrison, W., Sheard, T., Hook, J. (2002). Fine Control of Demand in Haskell. In: Boiten, E.A., Möller, B. (eds) Mathematics of Program Construction. MPC 2002. Lecture Notes in Computer Science, vol 2386. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45442-X_6

Download citation

  • DOI: https://doi.org/10.1007/3-540-45442-X_6

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43857-1

  • Online ISBN: 978-3-540-45442-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics