Why do Names defined in the current module lack a module name?

Simon Peyton-Jones simonpj at microsoft.com
Tue Apr 2 12:31:01 CEST 2013


Does this help
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/NameType

Something that starts top-level may not finish up as top-level.  Nested bindings are never qualified.

After TidyPgm, externally-visible names (to the linker) are qualified, ones local to the .o file are not.

Does it matter?

Simon

From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Johan Tibell
Sent: 28 March 2013 20:35
To: ghc-devs at haskell.org
Subject: Why do Names defined in the current module lack a module name?

Hi,

I'm writing an app that uses the GHC API to extract names from modules. I've written a little AST traversal that finds all Names in the type-checked AST and writes them to a file. I noticed that every Name defined in the current module (i.e. Names generated for top-level function definitions) lack a module name i.e. nameModule_maybe return Nothing. Why is this? Should I just assume that every time nameModule_maybe return Nothing the module name is in fact the name of the current module being compiled?

-- Johan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130402/0b706a78/attachment.htm>


More information about the ghc-devs mailing list