Currently GHCi does not support -XStaticPointers, which is quite annoying for those of us who actually use -XStaticPointers in day-to-day development. It would be great if GHCi could grow support for this extension.
When compiling a module, the FloatOut pass puts StaticPtrs in the top level and the tidy-core pass generates a C constructor function which inserts the top-level bindings in the static pointer table (SPT) when the module is loaded.
In GHCi, I guess that bindings could be inserted in the SPT when they are linked. I don't know if the FloatOut pass is used when compiling code in GHCi, if not, floating the static pointer values to the top-level would need to be accomplished otherwise.
One particularly hairy problem that arises here is that of breakpoint ticks interacting with FloatOut. Currently we disallow any floating through breakpoint ticks. However, static pointer support requires that we float out static expressions to the top level. I can see two options here,
Allow floating of StaticPtr values through breakpoints as a special case.
Disable breakpoint production while -XStaticPointers is enabled.
Given that (1) may give rise to some rather surprising behavior in the face of recursive groups (e.g. a recursive group with one StaticPtr and a bunch of other bindings; the whole group will need to be floated, killing breakpoint support for all floated code), I suspect that (2) is the only sensible option.
D2504 adds limited support for StaticPointers in GHCi. While expressions entered at the REPL still cannot contain static expressions, modules loaded into the interpreter may. This should recover the majority of the convenience that one previously lost with StaticPointers. Note, however, that there is a bit of a memory leak as static expressions will necessarily never be unloaded, even after the module that introduced them goes out of scope.