| Are you suggesting that some combination
| of GHC flags will allow us to
| achieve demodulization?
No, it won't. But GHC does actually do a lot
of what you want. There is a lot of tricky stuff
associated with establishing the correct name space,
and GHC does that. You could suck in a Haskell
module and print it out fully qualified:
module Baz(h,t) where
import Wug(h)
t = h 7 + 4
would become
Baz_t = Prelude.(+) (Wug_h 7) 4
To show that the name-space issue is not trivial,
check out:
module Foo where
import Baz(h)
f = h 4
would become
Foo_f = Wug_h 4 -- Note Wug_h not Baz_h
Other complications in doing this in a standalone
tool include dealing with qualified import, hiding,
'as' clauses, and so on.
It would be fairly easy to modify GHC to
spit out the fully qualified Haskell for one
module. You could then just concatenate all the
output.
Andy's comments about the prelude are on target.
You would almost certainly have to treat that specially.
Simon
|