DEV Community

Discussion on: Challenge: Write a program that never stops

Collapse
 
carstenk_dev profile image
Carsten

Haskell

go = 1:go
Collapse
 
craigmc08 profile image
Craig McIlwrath

Isn't this program fine? It never forces evaluation of go so the program immediately exits.

Collapse
 
carstenk_dev profile image
Carsten • Edited

of course I assumed you would evaluate the expression (for example in the repl)

you are technical right but it's a bit like commenting to all the others and saying "it's fine as long as you don't run it" ;)


just assume a

main = print go

there if you like