handle package:essence-of-live-coding

Container for unserialisable values, such as IORefs, threads, MVars, pointers, and device handles. In a Handle, you can store a mechanism to create and destroy a value that survives reloads occuring during live coding even if does not have a Data instance. Using the function handling, you can create a cell that will automatically initialise your value, and register it in the HandlingStateT monad transformer, which takes care of automatically destroying it (if necessary) when it does not occur anymore in a later revision of your live program. Have a look at Examples for some ready-to-use implementations. In short, Handle is an opaque, automatically constructing and garbage collecting container for arbitrary values in the live coding environment.
The same as flip catchE, which is useful in situations where the code for the handler is shorter.
Generalisation of Handle carrying an additional parameter which may change at runtime. Like in a Handle, the h value of a ParametrisedHandle is preserved through live coding reloads. Additionally, the parameter p value can be adjusted, and triggers a destruction and reinitialisation whenever it changes.
Combine two handles to one. Handles are not quite Monoids because of the extra type parameter, but it is possible to combine them. In the combined handle, the first handle is created first and destroyed last. Note: Handle is not an Applicative because it is not a Functor (because the destructor is contravariant in h).
Create an uninitialised MVar, with no special cleanup action.
Create an IORef, with no special cleanup action.
Create an MVar initialised to some value a, with no special cleanup action.
Launch a thread executing the given action and kill it when the handle is removed.