Given the following list from 1 to 100:
> let x = [1..100]
I run sprint x
to observe its unevaluated value.
I think this bheklilr's comment should be marked as the answer:
What is the type of x? If it's
(Num a, Enum a) => [a]
then this won't work as expected. Trylet x = [1..100] :: [Int
]. In reality, when you print x with the more general type GHCi specializes it to Integer to do the printing. This means that the values you see printed are not actually stored back in x's thunk. Using a concrete type avoids this problem.
With the additional note from David Young that this problem won't occur on GHCi versions earlier than 7.8, when the monomorphism restriction was enabled.