I'm new to Haskell and playing around trying to understand a few things. If I do the following I receive a problem:
list1 = [1..]
list2 = [x | x <- list1, x <= 4]
print list2
which returns [1,2,3,4
. There isn't an end bracket on it, so it is as if the list is loading or frozen. Here is how it looks:
Prelude> print list2
[1,2,3,4
What is going on here?