Open mikeplus64 opened 12 years ago
There are a couple of fixes that could be applied. One is we could add lazy nodes to the result stream and then round trip to demand them when they are 'poked' by the user. Separately, we could limit the default recursion depth of Display, and make it insert those or just temporarily put '...' when it goes too deep. The trick then is naming those temporaries.
If a user types in
[0..]
, ghclive alarmingly quickly consumes all your memory and 100% CPU, bringing the system to a grinding halt. In GHCi at least, a simple expression like[0..]
won't leak huge amounts of memory -- in fact, GHCi's memory usage stays seems to stay about the same.