The entire topic of space use in Haskell is not simple, but the part you
need here may be. As long as GHC can tell that values already written
to disk may be garbage collected, memory use is quite reasonable.
For example, here's a short program that prints a long-ish list:
xs :: [Double]
xs = map cos [1..1e7]
main :: IO ()
main = traverse_ print $ map sin xs