Hot code reloading: Check if the State type changed with Generics

We store the `show`ed type representation of the state.
This way we can detect whether the state changed when doing hot code
reloading in in-place restarts in ghci.

Using Generics, this really works on the *structure* of the `State`
type, so hot code reloading even works when the name of a field in
the `State` record changes!