Changes between Version 15 and Version 16 of Commentary/Compiler/RdrNameType


Ignore:
Timestamp:
Sep 21, 2015 1:39:15 PM (4 years ago)
Author:
rahulmutt
Comment:

Fixed broken links to source

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/RdrNameType

    v15 v16  
    44= {{{RdrNames}}}, {{{Modules}}}, and {{{OccNames}}} =
    55
    6 When the parser parses an identifier, it generates a {{{RdrName}}}.  A {{{RdrName}}} is pretty much just a string, or a pair of strings, for a qualified name, such as {{{M.x}}}.  Here's the data type declaration, from [[GhcFile(compiler/basicTypes/RdrName.lhs)]]:
     6When the parser parses an identifier, it generates a {{{RdrName}}}.  A {{{RdrName}}} is pretty much just a string, or a pair of strings, for a qualified name, such as {{{M.x}}}.  Here's the data type declaration, from [[GhcFile(compiler/basicTypes/RdrName.hs)]]:
    77{{{
    88data RdrName
     
    3434== The `Module` and `ModuleName` types ==
    3535
    36 In GHC, a ''module'' is uniquely defined by a pair of the module name and the package where the module is defined.  The details are in [[GhcFile(compiler/basicTypes/Module.lhs)]] and  [[GhcFile(compiler/main/PackageConfig.hs)]], but here are the key definitions:
     36In GHC, a ''module'' is uniquely defined by a pair of the module name and the package where the module is defined.  The details are in [[GhcFile(compiler/basicTypes/Module.hs)]] and  [[GhcFile(compiler/main/PackageConfig.hs)]], but here are the key definitions:
    3737{{{
    3838newtype PackageId = PId FastString
     
    4949
    5050An {{{OccName}}} is more-or-less just a string, like "foo" or "Tree", giving the (unqualified) name of an entity.
    51 Well, not quite just a string, because in Haskell a name like "C" could mean a type constructor or data constructor, depending on context. So GHC defines a type `OccName` that is a pair of a {{{FastString}}} and a {{{NameSpace}}} indicating which name space the name is drawn from. The data type is defined (abstractly) in [[GhcFile(compiler/basicTypes/OccName.lhs)]]:
     51Well, not quite just a string, because in Haskell a name like "C" could mean a type constructor or data constructor, depending on context. So GHC defines a type `OccName` that is a pair of a {{{FastString}}} and a {{{NameSpace}}} indicating which name space the name is drawn from. The data type is defined (abstractly) in [[GhcFile(compiler/basicTypes/OccName.hs)]]:
    5252{{{
    5353data OccName = OccName