data Dynamic where
Dyn :: Typeable a => a -> Dynamic
and you want to take advantage of this.
No need for these strange “data DsForeignsHook = DsForeignsHook” things, or for the Hook type family. Simple!
· The design *must* list all the hooks that GHC uses and their types. There’s no point in adding a hook that GHC doesn’t call!