Changes between Version 5 and Version 6 of Commentary/Compiler/RdrNameType
- Timestamp:
- 09/14/06 11:31:51 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Compiler/RdrNameType
v5 v6 49 49 An {{{OccName}}} is more-or-less just a string, like "foo" or "Tree", giving the (unqualified) name of an entity. 50 50 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 (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)]]: 51 {{{ 52 data OccName = OccName NameSpace FastString 51 {{ 52 data OccName = OccName 53 { occNameSpace :: !NameSpace 54 , occNameFS :: !FastString 55 } 53 56 }}} 54 The {{{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.57 {{{FastString}}} is a packed string implementation of strings. 55 58 56 59 The name spaces are:
