StateT package:essence-of-live-coding

In this monad, handles can be registered, and their destructors automatically executed. It is basically a monad in which handles are automatically garbage collected.
Handle the HandlingStateT effect _without_ garbage collection. Apply this to your main loop after calling foreground. Since there is no garbage collection, don't use this function for live coding.