[Haskell-cafe] Enumerating functions at runtime

Don Stewart dons00 at gmail.com
Sun Mar 24 12:22:10 CET 2013


All the info is in the .hi files

On Sunday, 24 March 2013, Brent Yorgey wrote:

> On Sat, Mar 23, 2013 at 08:26:52PM -0700, Luke Evans wrote:
> > 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?
> >
> > If it's just not possible to introspect on compiled modules, then I
> suppose I could use external metadata of my own, or even perhaps haddock
> info if it exists, to attempt to generate this info.  Clearly though,
> that's nowhere near as good as extracting the info from something the
> compiler built directly.
>
> I have no idea how it works, but I'm pretty sure yi does this ---
> e.g. if you hit M-x (when in emacs emulation mode) and then
> tab-complete, you see a list of all the available functions.  Maybe
> you want to take a look at the yi source code and see how they do it.
>
> -Brent
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org <javascript:;>
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130324/0ac71ca0/attachment.htm>


More information about the Haskell-Cafe mailing list