I started reading Mr.Simon’s Parallel and Concurrent Programming in Haskell today.In the chapter 2.1,it gave examples of lazy evaluation:
ghci> let x = 1 + 2
ghci> :sprint x
x = _
ghci> x
3
ghci> :sprint x
x = 3
But when I try in GHCi, version 9.2.8
,only get:
ghci> let x = 1 + 2
ghci> :sprint x
x = _
ghci> x
3
ghci> :sprint x
x = _
ghci> seq x 2
2
ghci> :sprint x
x = _
Has ghci
changed the behavior of :sprint
?Could someone give me some explanation of the reasons for it?