what is the path to a particular module?

Is there a way from GHCi to discover the path to a particular module that you have imported or loaded? -Alex-

On Fri, 14 Aug 2009 14:50:48 -0400, S. Alexander Jacobson wrote:
Is there a way from GHCi to discover the path to a particular module that you have imported or loaded?
It may not be what you wanted but in the worst case you can use ghc-pkg list to see all the package names then for each name you can do ghc-pkg describe to see there it is installed and what modules it does expose. All the information is in <ghc-install-dir>/package.conf which just seems to be a list of InstalledPackageInfo (Distribution.InstalledPackageInfo). So it should be possible to write a function you want easily. Surprisingly when I tried to read the list of InstalledPackageInfo from my package.conf it failed despite ghc-pkg working well. I did not investigate why. Maybe there is a better way. Peter.

Is there a way from GHCi to discover the path to a particular module that you have imported or loaded?
If you do "ghci -v4" it will print out all the exposed modules right below the package that exposes them and the directory the package is in. You could just copy/paste this text and do a simple text search in your edit or choice. I don't know how to get it to print this information when you load a module, but GHCi is easy enough to read so perhaps you could make a patch and send it in! Thomas
participants (3)
-
Peter Hercek
-
S. Alexander Jacobson
-
Thomas DuBuisson