[Haskell-cafe] Strict evaluation not working?

Christian Hofer Christian.Hofer at gmx.de
Tue Oct 12 12:07:43 EDT 2004


Hi,

having found a bit of time to play with Haskell, I am trying to figure 
out how to enforce strict evaluation.
I wrote the following program:

main =
	let x = zipWith (+) [5..] [6..]
	in putStrLn $ show $ x `seq` head x

I expected this program not to terminate - because of the seq-Operator, 
but it happily returns 11 in ghc as well as in ghci. What do I make 
wrong?

Chris



More information about the Haskell-Cafe mailing list