s stands for “simple,” the idea being that
:sprint is in some sense a simplified version of the
:sprint does less work. command in GHCi prints a value without forcing any evaluation. This is useful for experimenting to find out which parts of a data structure are evaluated.
In this example, first we define a list from
z. Initially, none of it has been evaluated, so when we
:sprint it, all we see is
If we do something that causes part of the list to be evaluated (like looking at the element at index
:sprint now gives us the part of the list that has been evaluated so far.
And so on.
length of a list is a common way to accidentally force evaluation of the entire thing.