I'm curious about using Haskell for metaprogramming.
It looks like I can dynamically compile, load and run some Haskell with the plugins package. Actually I've briefly tried this and it seems to work for some simple cases at least.
Now I would like to be able to enumerate precompiled public functions in modules that I might use as building blocks in such dynamic compilation. So far I'm not seeing anything that does this directly.
Can anyone provide some pointers?
I'm not aware of any canned solutions, but one way you could do it is to enumerate the symbol table of a compiled module and z-decode symbols; functions get their types z-encoded into their symbol table names. A more likely useful way is to extract them from the .hi file; there should be functions in ghc-api and likely in hint to do this, since the compiler must do so as part of importing a module; or at worst, you can use ghc -print-iface to decode a .hi file to text and extract the information that way.
--