Changes between Version 4 and Version 5 of Commentary/Compiler/RdrNameType


Ignore:
Timestamp:
Sep 14, 2006 6:30:05 PM (9 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/RdrNameType

    v4 v5  
    5050Well, 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 (defined in basicTypes/OccName.lhs) 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)]]: 
    5151{{{ 
    52 data OccName = OccName NameSpace EncodedFS 
     52data OccName = OccName NameSpace FastString 
    5353}}} 
    5454The {{{EncodedFS}}} is a synonym for {{{FastString}}} indicating that the string is Z-encoded. (Details in [[GhcFile(compiler/basicTypes/OccName.lhs)]].) Z-encoding encodes funny characters like '%' and '$' into alphabetic characters, like "zp" and "zd", so that they can be used in object-file symbol tables without confusing linkers and suchlike.