Here is the problem: sometimes, when playing with GHCI, I end up running an infinite computation by mistake. When this happens, most times, my computer crashes and I'm not even able to interrupt it using Ctrl+C. I wonder if there is a way to run GHCI (or another interactive console like Hugs) in some mode that allows me to interrupt the program before the memory runs out. Maybe setting a virtual limit for the recursion depth or for the memory used.
(This question may be a duplicated of Is there a way to limit the memory, ghci can have? but this also considers the posibility of a recursion depth limit, not just memory limit.)