Exported modules in the GHC API

Simon Marlow marlowsd at gmail.com
Mon May 23 13:06:10 CEST 2011


On 22/05/2011 11:50, David Waern wrote:
> Hi,
>
> When encountering an IEModuleContents ModuleName export item, I'd like
> a simple way to get its original Module (with the original module name and
> package ID). It seems a bit complicated to have to go through the
> import items to figure this out. My question is: is there a simpler
> way, and if not,
> do you agree that the API should provide a simpler way?

This is the way it's defined in Haskell - a 'module' export expands to 
all those names in scope qualified with that module name.  There might 
be several different modules imported with that name, and the 'module' 
export would export the contents of all of them.  So I'm afraid you have 
to traverse the whole of the scope.

I suspect we don't do this properly in Haddock, since the documentation 
always contains just a link to the exported module, right?

Cheers,
	Simon




More information about the Glasgow-haskell-users mailing list