Skip to Main Content
Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library
book

Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library

by Stefania Loredana Nita, Marius Mihailescu
June 2019
Intermediate to advanced content levelIntermediate to advanced
213 pages
3h 10m
English
Apress
Content preview from Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library
© Stefania Loredana Nita and Marius Mihailescu 2019
Stefania Loredana Nita and Marius MihailescuHaskell Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4507-1_21

21. Lazy Evaluation

Stefania Loredana Nita1  and Marius Mihailescu1
(1)
Bucharest, Romania
 

You already know that Haskell is based on lazy evaluation. This means that the expressions are evaluated only when it is necessary. But what is “necessary”? In this chapter, you will get an answer to that question, and you will take a deeper look at lazy evaluation in Haskell.

First, let’s take a look at strict evaluation, which is the opposite of lazy evaluation. Suppose you have this function:
f x y = 2*y

If you call f (1234^100) 3, in strict evaluation the first argument will be evaluated and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Haskell Data Analysis cookbook

Haskell Data Analysis cookbook

Nishant Shukla

Publisher Resources

ISBN: 9781484245071Purchase LinkPublisher Website