© Alejandro Serrano Mena 2019
Alejandro Serrano MenaPractical Haskellhttps://doi.org/10.1007/978-1-4842-4480-7_5

5. Laziness and Infinite Structures

Alejandro Serrano Mena1 
Utrecht, The Netherlands

In previous chapters I introduced several of the pillars of Haskell programming: the pure functional paradigm and the strongly typed nature of the language, which nevertheless allows powerful type constructs such as parametric polymorphism and type classes. This chapter will be devoted to understanding the unique evaluation model of Haskell, based on laziness , and the consequences of that choice.

In short, lazy evaluation means that only the necessary parts of an expression are computed, and this is done at the last possible moment. For example, if ...

Get Practical Haskell: A Real World Guide to Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.