[Haskell] Haskell Reflection

Oleg Mürk oleg.myrk at gmail.com
Tue Apr 18 17:21:58 EDT 2006


Hello,

I want to do the following wierd things with arbitrary Haskell program:
* Have an IO callback each time a closure is forced
* Dynamically load small Haskell expressions that will be executed in the
callback
* Have access to the syntactic scope of closure being forced in the
dynamically loaded expressions
* Navigate data graph a'la Java reflection
* Test if given closure has been forced

I see two ways of doing this:
1) Some Haskell implementation having super-reflective capabilities
2) Doing Haskell program transformation before running it

(1) seems doubtful, but I would be more than happy if someone proved me
wrong :)

As for (2), I would kindly ask the readers of this list for suggestions:
* Which program tranformation tool to use. I need to compute syntactic scope
of the closures.
   And I need to know exact line and row numbers of syntactic constructions.
Knowing types
   of expressions of the program being transformed doesn't hurt either.
* Most of the features described above are straightforward to implement, but
if some of these
   have been implemented before I would be more than happy to reuse them.

In any case I would still need to load dynamically small Haskell
expressions.
What is the best way to do it?

Disclaimer: I am not planning to do application programming using these
techniques :)

With kind regards,
Oleg Mürk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell/attachments/20060418/345c1e56/attachment.htm


More information about the Haskell mailing list