<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>RdrName</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_RdrName.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">ghc-7.4.2: The GHC API</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">RdrName</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The main type </a><ul><li><a href="#g:2">Construction </a></li><li><a href="#g:3">Destruction </a></li><li><a href="#g:4">Printing </a></li></ul></li><li><a href="#g:5">Local mapping of <code><a href="RdrName.html#t:RdrName">RdrName</a></code> to <code><a href="Name.html#t:Name">Name</a></code> </a></li><li><a href="#g:6">Global mapping of <code><a href="RdrName.html#t:RdrName">RdrName</a></code> to <code><a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a></code>s </a><ul><li><a href="#g:7">Global <code><a href="RdrName.html#t:RdrName">RdrName</a></code> mapping elements: <code><a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a></code>, <code><a href="RdrName.html#t:Provenance">Provenance</a></code>, <code><a href="RdrName.html#t:ImportSpec">ImportSpec</a></code> </a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p><a name="name_types"></a> GHC uses several kinds of name internally: </p><ul><li> <code><a href="OccName.html#t:OccName">OccName</a></code>: see <a href="OccName.html#name_types">OccName</a> </li><li> <code><a href="RdrName.html#t:RdrName">RdrName</a></code> is the type of names that come directly from the parser. They have not yet had their scoping and binding resolved by the renamer and can be thought of to a first approximation as an <code><a href="OccName.html#t:OccName">OccName</a></code> with an optional module qualifier </li><li> <code><a href="Name.html#t:Name">Name</a></code>: see <a href="Name.html#name_types">Name</a> </li><li> <code><a href="Id.html#t:Id">Id</a></code>: see <a href="Id.html#name_types">Id</a> </li><li> <code><a href="Var.html#t:Var">Var</a></code>: see <a href="Var.html#name_types">Var</a> </li></ul></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:RdrName">RdrName</a> <ul class="subs"><li>= <a href="#v:Unqual">Unqual</a> <a href="OccName.html#t:OccName">OccName</a> </li><li>| <a href="#v:Qual">Qual</a> <a href="Module.html#t:ModuleName">ModuleName</a> <a href="OccName.html#t:OccName">OccName</a> </li><li>| <a href="#v:Orig">Orig</a> <a href="Module.html#t:Module">Module</a> <a href="OccName.html#t:OccName">OccName</a> </li><li>| <a href="#v:Exact">Exact</a> <a href="Name.html#t:Name">Name</a> </li></ul></li><li class="src short"><a href="#v:mkRdrUnqual">mkRdrUnqual</a> :: <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:mkRdrQual">mkRdrQual</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:mkUnqual">mkUnqual</a> :: <a href="OccName.html#t:NameSpace">NameSpace</a> -> <a href="FastString.html#t:FastString">FastString</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:mkVarUnqual">mkVarUnqual</a> :: <a href="FastString.html#t:FastString">FastString</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:mkQual">mkQual</a> :: <a href="OccName.html#t:NameSpace">NameSpace</a> -> (<a href="FastString.html#t:FastString">FastString</a>, <a href="FastString.html#t:FastString">FastString</a>) -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:mkOrig">mkOrig</a> :: <a href="Module.html#t:Module">Module</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:nameRdrName">nameRdrName</a> :: <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:getRdrName">getRdrName</a> :: <a href="Name.html#t:NamedThing">NamedThing</a> thing => thing -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:rdrNameOcc">rdrNameOcc</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:OccName">OccName</a></li><li class="src short"><a href="#v:rdrNameSpace">rdrNameSpace</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:NameSpace">NameSpace</a></li><li class="src short"><a href="#v:setRdrNameSpace">setRdrNameSpace</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:NameSpace">NameSpace</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:demoteRdrName">demoteRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="RdrName.html#t:RdrName">RdrName</a></li><li class="src short"><a href="#v:isRdrDataCon">isRdrDataCon</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isRdrTyVar">isRdrTyVar</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isRdrTc">isRdrTc</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isQual">isQual</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isQual_maybe">isQual_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Module.html#t:ModuleName">ModuleName</a>, <a href="OccName.html#t:OccName">OccName</a>)</li><li class="src short"><a href="#v:isUnqual">isUnqual</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isOrig">isOrig</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isOrig_maybe">isOrig_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Module.html#t:Module">Module</a>, <a href="OccName.html#t:OccName">OccName</a>)</li><li class="src short"><a href="#v:isExact">isExact</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isExact_maybe">isExact_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></li><li class="src short"><a href="#v:isSrcRdrName">isSrcRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:showRdrName">showRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:LocalRdrEnv">LocalRdrEnv</a> = (<a href="OccName.html#t:OccEnv">OccEnv</a> <a href="Name.html#t:Name">Name</a>, <a href="NameSet.html#t:NameSet">NameSet</a>)</li><li class="src short"><a href="#v:emptyLocalRdrEnv">emptyLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></li><li class="src short"><a href="#v:extendLocalRdrEnv">extendLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></li><li class="src short"><a href="#v:extendLocalRdrEnvList">extendLocalRdrEnvList</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="Name.html#t:Name">Name</a>] -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></li><li class="src short"><a href="#v:lookupLocalRdrEnv">lookupLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></li><li class="src short"><a href="#v:lookupLocalRdrOcc">lookupLocalRdrOcc</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></li><li class="src short"><a href="#v:elemLocalRdrEnv">elemLocalRdrEnv</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:inLocalRdrEnvScope">inLocalRdrEnvScope</a> :: <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:localRdrEnvElts">localRdrEnvElts</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="Name.html#t:Name">Name</a>]</li><li class="src short"><a href="#v:delLocalRdrEnvList">delLocalRdrEnvList</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="OccName.html#t:OccName">OccName</a>] -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:GlobalRdrEnv">GlobalRdrEnv</a> = <a href="OccName.html#t:OccEnv">OccEnv</a> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><a href="#v:emptyGlobalRdrEnv">emptyGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></li><li class="src short"><a href="#v:mkGlobalRdrEnv">mkGlobalRdrEnv</a> :: [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>] -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></li><li class="src short"><a href="#v:plusGlobalRdrEnv">plusGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></li><li class="src short"><a href="#v:lookupGlobalRdrEnv">lookupGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="OccName.html#t:OccName">OccName</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><a href="#v:extendGlobalRdrEnv">extendGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></li><li class="src short"><a href="#v:pprGlobalRdrEnv">pprGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><a href="#v:globalRdrEnvElts">globalRdrEnvElts</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><a href="#v:lookupGRE_RdrName">lookupGRE_RdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><a href="#v:lookupGRE_Name">lookupGRE_Name</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><a href="#v:getGRE_NameQualifier_maybes">getGRE_NameQualifier_maybes</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> [<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Module.html#t:ModuleName">ModuleName</a>]]</li><li class="src short"><a href="#v:transformGREs">transformGREs</a> :: (<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>) -> [<a href="OccName.html#t:OccName">OccName</a>] -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></li><li class="src short"><a href="#v:findLocalDupsRdrEnv">findLocalDupsRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="OccName.html#t:OccName">OccName</a>] -> (<a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a>, [[<a href="Name.html#t:Name">Name</a>]])</li><li class="src short"><a href="#v:pickGREs">pickGREs</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>] -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:GlobalRdrElt">GlobalRdrElt</a> = <a href="#v:GRE">GRE</a> {<ul class="subs"><li><a href="#v:gre_name">gre_name</a> :: <a href="Name.html#t:Name">Name</a></li><li><a href="#v:gre_par">gre_par</a> :: <a href="RdrName.html#t:Parent">Parent</a></li><li><a href="#v:gre_prov">gre_prov</a> :: <a href="RdrName.html#t:Provenance">Provenance</a></li></ul>}</li><li class="src short"><a href="#v:isLocalGRE">isLocalGRE</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:unQualOK">unQualOK</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:qualSpecOK">qualSpecOK</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:unQualSpecOK">unQualSpecOK</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Provenance">Provenance</a> <ul class="subs"><li>= <a href="#v:LocalDef">LocalDef</a> </li><li>| <a href="#v:Imported">Imported</a> [<a href="RdrName.html#t:ImportSpec">ImportSpec</a>] </li></ul></li><li class="src short"><a href="#v:pprNameProvenance">pprNameProvenance</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="Outputable.html#t:SDoc">SDoc</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Parent">Parent</a> <ul class="subs"><li>= <a href="#v:NoParent">NoParent</a> </li><li>| <a href="#v:ParentIs">ParentIs</a> <a href="Name.html#t:Name">Name</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:ImportSpec">ImportSpec</a> = <a href="#v:ImpSpec">ImpSpec</a> {<ul class="subs"><li><a href="#v:is_decl">is_decl</a> :: <a href="RdrName.html#t:ImpDeclSpec">ImpDeclSpec</a></li><li><a href="#v:is_item">is_item</a> :: <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:ImpDeclSpec">ImpDeclSpec</a> = <a href="#v:ImpDeclSpec">ImpDeclSpec</a> {<ul class="subs"><li><a href="#v:is_mod">is_mod</a> :: <a href="Module.html#t:ModuleName">ModuleName</a></li><li><a href="#v:is_as">is_as</a> :: <a href="Module.html#t:ModuleName">ModuleName</a></li><li><a href="#v:is_qual">is_qual</a> :: <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:is_dloc">is_dloc</a> :: <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:ImpItemSpec">ImpItemSpec</a> <ul class="subs"><li>= <a href="#v:ImpAll">ImpAll</a> </li><li>| <a href="#v:ImpSome">ImpSome</a> { <ul class="subs"><li><a href="#v:is_explicit">is_explicit</a> :: <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:is_iloc">is_iloc</a> :: <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></li></ul> }</li></ul></li><li class="src short"><a href="#v:importSpecLoc">importSpecLoc</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></li><li class="src short"><a href="#v:importSpecModule">importSpecModule</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="Module.html#t:ModuleName">ModuleName</a></li><li class="src short"><a href="#v:isExplicitItem">isExplicitItem</a> :: <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">The main type </h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:RdrName" class="def">RdrName</a> </p><div class="doc"><p>Do not use the data constructors of RdrName directly: prefer the family of functions that creates them, such as <code><a href="RdrName.html#v:mkRdrUnqual">mkRdrUnqual</a></code> </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Unqual" class="def">Unqual</a> <a href="OccName.html#t:OccName">OccName</a></td><td class="doc"><p>Used for ordinary, unqualified occurrences, e.g. <code>x</code>, <code>y</code> or <code>Foo</code>. Create such a <code><a href="RdrName.html#t:RdrName">RdrName</a></code> with <code><a href="RdrName.html#v:mkRdrUnqual">mkRdrUnqual</a></code> </p></td></tr><tr><td class="src"><a name="v:Qual" class="def">Qual</a> <a href="Module.html#t:ModuleName">ModuleName</a> <a href="OccName.html#t:OccName">OccName</a></td><td class="doc"><p>A qualified name written by the user in <em>source</em> code. The module isn't necessarily the module where the thing is defined; just the one from which it is imported. Examples are <code>Bar.x</code>, <code>Bar.y</code> or <code>Bar.Foo</code>. Create such a <code><a href="RdrName.html#t:RdrName">RdrName</a></code> with <code><a href="RdrName.html#v:mkRdrQual">mkRdrQual</a></code> </p></td></tr><tr><td class="src"><a name="v:Orig" class="def">Orig</a> <a href="Module.html#t:Module">Module</a> <a href="OccName.html#t:OccName">OccName</a></td><td class="doc"><p>An original name; the module is the <em>defining</em> module. This is used when GHC generates code that will be fed into the renamer (e.g. from deriving clauses), but where we want to say "Use Prelude.map dammit". One of these can be created with <code><a href="RdrName.html#v:mkOrig">mkOrig</a></code> </p></td></tr><tr><td class="src"><a name="v:Exact" class="def">Exact</a> <a href="Name.html#t:Name">Name</a></td><td class="doc"><p>We know exactly the <code><a href="Name.html#t:Name">Name</a></code>. This is used: </p><ol><li> When the parser parses built-in syntax like <code>[]</code> and <code>(,)</code>, but wants a <code><a href="RdrName.html#t:RdrName">RdrName</a></code> from it </li><li> By Template Haskell, when TH has generated a unique name </li></ol><p>Such a <code><a href="RdrName.html#t:RdrName">RdrName</a></code> can be created by using <code><a href="RdrName.html#v:getRdrName">getRdrName</a></code> on a <code><a href="Name.html#t:Name">Name</a></code> </p></td></tr></table></div><div class="subs instances"><p id="control.i:RdrName" class="caption collapser" onclick="toggleSection('i:RdrName')">Instances</p><div id="section.i:RdrName" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Data.html#t:Data">Data</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Outputable.html#t:OutputableBndr">OutputableBndr</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="RdrName.html#t:RdrName">RdrName</a></td><td class="doc empty"> </td></tr></table></div></div></div><h2 id="g:2">Construction </h2><div class="top"><p class="src"><a name="v:mkRdrUnqual" class="def">mkRdrUnqual</a> :: <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:mkRdrQual" class="def">mkRdrQual</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:mkUnqual" class="def">mkUnqual</a> :: <a href="OccName.html#t:NameSpace">NameSpace</a> -> <a href="FastString.html#t:FastString">FastString</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:mkVarUnqual" class="def">mkVarUnqual</a> :: <a href="FastString.html#t:FastString">FastString</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:mkQual" class="def">mkQual</a> :: <a href="OccName.html#t:NameSpace">NameSpace</a> -> (<a href="FastString.html#t:FastString">FastString</a>, <a href="FastString.html#t:FastString">FastString</a>) -> <a href="RdrName.html#t:RdrName">RdrName</a></p><div class="doc"><p>Make a qualified <code><a href="RdrName.html#t:RdrName">RdrName</a></code> in the given namespace and where the <code><a href="Module.html#t:ModuleName">ModuleName</a></code> and the <code><a href="OccName.html#t:OccName">OccName</a></code> are taken from the first and second elements of the tuple respectively </p></div></div><div class="top"><p class="src"><a name="v:mkOrig" class="def">mkOrig</a> :: <a href="Module.html#t:Module">Module</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:nameRdrName" class="def">nameRdrName</a> :: <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:getRdrName" class="def">getRdrName</a> :: <a href="Name.html#t:NamedThing">NamedThing</a> thing => thing -> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><h2 id="g:3">Destruction </h2><div class="top"><p class="src"><a name="v:rdrNameOcc" class="def">rdrNameOcc</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:OccName">OccName</a></p></div><div class="top"><p class="src"><a name="v:rdrNameSpace" class="def">rdrNameSpace</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:NameSpace">NameSpace</a></p></div><div class="top"><p class="src"><a name="v:setRdrNameSpace" class="def">setRdrNameSpace</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="OccName.html#t:NameSpace">NameSpace</a> -> <a href="RdrName.html#t:RdrName">RdrName</a></p><div class="doc"><p>This rather gruesome function is used mainly by the parser. When parsing: </p><pre> data T a = T | T1 Int </pre><p>we parse the data constructors as <em>types</em> because of parser ambiguities, so then we need to change the <em>type constr</em> to a <em>data constr</em> </p><p>The exact-name case <em>can</em> occur when parsing: </p><pre> data [] a = [] | a : [a] </pre><p>For the exact-name case we return an original name. </p></div></div><div class="top"><p class="src"><a name="v:demoteRdrName" class="def">demoteRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="RdrName.html#t:RdrName">RdrName</a></p></div><div class="top"><p class="src"><a name="v:isRdrDataCon" class="def">isRdrDataCon</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isRdrTyVar" class="def">isRdrTyVar</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isRdrTc" class="def">isRdrTc</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isQual" class="def">isQual</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isQual_maybe" class="def">isQual_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Module.html#t:ModuleName">ModuleName</a>, <a href="OccName.html#t:OccName">OccName</a>)</p></div><div class="top"><p class="src"><a name="v:isUnqual" class="def">isUnqual</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isOrig" class="def">isOrig</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isOrig_maybe" class="def">isOrig_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Module.html#t:Module">Module</a>, <a href="OccName.html#t:OccName">OccName</a>)</p></div><div class="top"><p class="src"><a name="v:isExact" class="def">isExact</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:isExact_maybe" class="def">isExact_maybe</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></p></div><div class="top"><p class="src"><a name="v:isSrcRdrName" class="def">isSrcRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><h2 id="g:4">Printing </h2><div class="top"><p class="src"><a name="v:showRdrName" class="def">showRdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p></div><h1 id="g:5">Local mapping of <code><a href="RdrName.html#t:RdrName">RdrName</a></code> to <code><a href="Name.html#t:Name">Name</a></code> </h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:LocalRdrEnv" class="def">LocalRdrEnv</a> = (<a href="OccName.html#t:OccEnv">OccEnv</a> <a href="Name.html#t:Name">Name</a>, <a href="NameSet.html#t:NameSet">NameSet</a>)</p><div class="doc"><p>This environment is used to store local bindings (<code>let</code>, <code>where</code>, lambda, <code>case</code>). It is keyed by OccName, because we never use it for qualified names We keep the current mapping, *and* the set of all Names in scope Reason: see Note [Splicing Exact Names] in RnEnv </p></div></div><div class="top"><p class="src"><a name="v:emptyLocalRdrEnv" class="def">emptyLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:extendLocalRdrEnv" class="def">extendLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:extendLocalRdrEnvList" class="def">extendLocalRdrEnvList</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="Name.html#t:Name">Name</a>] -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:lookupLocalRdrEnv" class="def">lookupLocalRdrEnv</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></p></div><div class="top"><p class="src"><a name="v:lookupLocalRdrOcc" class="def">lookupLocalRdrOcc</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="OccName.html#t:OccName">OccName</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Name.html#t:Name">Name</a></p></div><div class="top"><p class="src"><a name="v:elemLocalRdrEnv" class="def">elemLocalRdrEnv</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:inLocalRdrEnvScope" class="def">inLocalRdrEnvScope</a> :: <a href="Name.html#t:Name">Name</a> -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:localRdrEnvElts" class="def">localRdrEnvElts</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="Name.html#t:Name">Name</a>]</p></div><div class="top"><p class="src"><a name="v:delLocalRdrEnvList" class="def">delLocalRdrEnvList</a> :: <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a> -> [<a href="OccName.html#t:OccName">OccName</a>] -> <a href="RdrName.html#t:LocalRdrEnv">LocalRdrEnv</a></p></div><h1 id="g:6">Global mapping of <code><a href="RdrName.html#t:RdrName">RdrName</a></code> to <code><a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a></code>s </h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:GlobalRdrEnv" class="def">GlobalRdrEnv</a> = <a href="OccName.html#t:OccEnv">OccEnv</a> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p><div class="doc"><p>Keyed by <code><a href="OccName.html#t:OccName">OccName</a></code>; when looking up a qualified name we look up the <code><a href="OccName.html#t:OccName">OccName</a></code> part, and then check the <code><a href="RdrName.html#t:Provenance">Provenance</a></code> to see if the appropriate qualification is valid. This saves routinely doubling the size of the env by adding both qualified and unqualified names to the domain. </p><p>The list in the codomain is required because there may be name clashes These only get reported on lookup, not on construction </p><p>INVARIANT: All the members of the list have distinct <code><a href="RdrName.html#v:gre_name">gre_name</a></code> fields; that is, no duplicate Names </p><p>INVARIANT: Imported provenance => Name is an ExternalName However LocalDefs can have an InternalName. This happens only when type-checking a [d| ... |] Template Haskell quotation; see this note in RnNames Note [Top-level Names in Template Haskell decl quotes] </p></div></div><div class="top"><p class="src"><a name="v:emptyGlobalRdrEnv" class="def">emptyGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:mkGlobalRdrEnv" class="def">mkGlobalRdrEnv</a> :: [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>] -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:plusGlobalRdrEnv" class="def">plusGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:lookupGlobalRdrEnv" class="def">lookupGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="OccName.html#t:OccName">OccName</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p></div><div class="top"><p class="src"><a name="v:extendGlobalRdrEnv" class="def">extendGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></p></div><div class="top"><p class="src"><a name="v:pprGlobalRdrEnv" class="def">pprGlobalRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Outputable.html#t:SDoc">SDoc</a></p></div><div class="top"><p class="src"><a name="v:globalRdrEnvElts" class="def">globalRdrEnvElts</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p></div><div class="top"><p class="src"><a name="v:lookupGRE_RdrName" class="def">lookupGRE_RdrName</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p></div><div class="top"><p class="src"><a name="v:lookupGRE_Name" class="def">lookupGRE_Name</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p></div><div class="top"><p class="src"><a name="v:getGRE_NameQualifier_maybes" class="def">getGRE_NameQualifier_maybes</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="Name.html#t:Name">Name</a> -> [<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Module.html#t:ModuleName">ModuleName</a>]]</p></div><div class="top"><p class="src"><a name="v:transformGREs" class="def">transformGREs</a> :: (<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>) -> [<a href="OccName.html#t:OccName">OccName</a>] -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></p><div class="doc"><p>Apply a transformation function to the GREs for these OccNames </p></div></div><div class="top"><p class="src"><a name="v:findLocalDupsRdrEnv" class="def">findLocalDupsRdrEnv</a> :: <a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a> -> [<a href="OccName.html#t:OccName">OccName</a>] -> (<a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a>, [[<a href="Name.html#t:Name">Name</a>]])</p><div class="doc"><p>For each <code><a href="OccName.html#t:OccName">OccName</a></code>, see if there are multiple local definitions for it. If so, remove all but one (to suppress subsequent error messages) and return a list of the duplicate bindings </p></div></div><div class="top"><p class="src"><a name="v:pickGREs" class="def">pickGREs</a> :: <a href="RdrName.html#t:RdrName">RdrName</a> -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>] -> [<a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a>]</p><div class="doc"><p>Take a list of GREs which have the right OccName Pick those GREs that are suitable for this RdrName And for those, keep only only the Provenances that are suitable </p><p>Consider: </p><pre> module A ( f ) where import qualified Foo( f ) import Baz( f ) f = undefined </pre><p>Let's suppose that <code>Foo.f</code> and <code>Baz.f</code> are the same entity really. The export of <code>f</code> is ambiguous because it's in scope from the local def and the import. The lookup of <code>Unqual f</code> should return a GRE for the locally-defined <code>f</code>, and a GRE for the imported <code>f</code>, with a <em>single</em> provenance, namely the one for <code>Baz(f)</code>. </p></div></div><h2 id="g:7">Global <code><a href="RdrName.html#t:RdrName">RdrName</a></code> mapping elements: <code><a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a></code>, <code><a href="RdrName.html#t:Provenance">Provenance</a></code>, <code><a href="RdrName.html#t:ImportSpec">ImportSpec</a></code> </h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:GlobalRdrElt" class="def">GlobalRdrElt</a> </p><div class="doc"><p>An element of the <code><a href="RdrName.html#t:GlobalRdrEnv">GlobalRdrEnv</a></code> </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GRE" class="def">GRE</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:gre_name" class="def">gre_name</a> :: <a href="Name.html#t:Name">Name</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:gre_par" class="def">gre_par</a> :: <a href="RdrName.html#t:Parent">Parent</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:gre_prov" class="def">gre_prov</a> :: <a href="RdrName.html#t:Provenance">Provenance</a></dt><dd class="doc"><p>Why it's in scope </p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:GlobalRdrElt" class="caption collapser" onclick="toggleSection('i:GlobalRdrElt')">Instances</p><div id="section.i:GlobalRdrElt" class="show"><table><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:isLocalGRE" class="def">isLocalGRE</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:unQualOK" class="def">unQualOK</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Test if an unqualifed version of this thing would be in scope </p></div></div><div class="top"><p class="src"><a name="v:qualSpecOK" class="def">qualSpecOK</a> :: <a href="Module.html#t:ModuleName">ModuleName</a> -> <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is in scope qualified with the given module? </p></div></div><div class="top"><p class="src"><a name="v:unQualSpecOK" class="def">unQualSpecOK</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is in scope unqualified? </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Provenance" class="def">Provenance</a> </p><div class="doc"><p>The <code><a href="RdrName.html#t:Provenance">Provenance</a></code> of something says how it came to be in scope. It's quite elaborate so that we can give accurate unused-name warnings. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:LocalDef" class="def">LocalDef</a></td><td class="doc"><p>The thing was defined locally </p></td></tr><tr><td class="src"><a name="v:Imported" class="def">Imported</a> [<a href="RdrName.html#t:ImportSpec">ImportSpec</a>]</td><td class="doc"><p>The thing was imported. </p><p>INVARIANT: the list of <code><a href="RdrName.html#t:ImportSpec">ImportSpec</a></code> is non-empty </p></td></tr></table></div><div class="subs instances"><p id="control.i:Provenance" class="caption collapser" onclick="toggleSection('i:Provenance')">Instances</p><div id="section.i:Provenance" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:Provenance">Provenance</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="RdrName.html#t:Provenance">Provenance</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:pprNameProvenance" class="def">pprNameProvenance</a> :: <a href="RdrName.html#t:GlobalRdrElt">GlobalRdrElt</a> -> <a href="Outputable.html#t:SDoc">SDoc</a></p><div class="doc"><p>Print out the place where the name was imported </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Parent" class="def">Parent</a> </p><div class="doc"><p>The children of a Name are the things that are abbreviated by the <a href="--.html">..</a> notation in export lists. See Note [Parents] </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NoParent" class="def">NoParent</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ParentIs" class="def">ParentIs</a> <a href="Name.html#t:Name">Name</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Parent" class="caption collapser" onclick="toggleSection('i:Parent')">Instances</p><div id="section.i:Parent" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:Parent">Parent</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="RdrName.html#t:Parent">Parent</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ImportSpec" class="def">ImportSpec</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ImpSpec" class="def">ImpSpec</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:is_decl" class="def">is_decl</a> :: <a href="RdrName.html#t:ImpDeclSpec">ImpDeclSpec</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:is_item" class="def">is_item</a> :: <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ImportSpec" class="caption collapser" onclick="toggleSection('i:ImportSpec')">Instances</p><div id="section.i:ImportSpec" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:ImportSpec">ImportSpec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="RdrName.html#t:ImportSpec">ImportSpec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Outputable.html#t:Outputable">Outputable</a> <a href="RdrName.html#t:ImportSpec">ImportSpec</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ImpDeclSpec" class="def">ImpDeclSpec</a> </p><div class="doc"><p>Describes a particular import declaration and is shared among all the <code><a href="RdrName.html#t:Provenance">Provenance</a></code>s for that decl </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ImpDeclSpec" class="def">ImpDeclSpec</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:is_mod" class="def">is_mod</a> :: <a href="Module.html#t:ModuleName">ModuleName</a></dt><dd class="doc"><p>Module imported, e.g. <code>import Muggle</code> Note the <code>Muggle</code> may well not be the defining module for this thing! </p></dd><dt class="src"><a name="v:is_as" class="def">is_as</a> :: <a href="Module.html#t:ModuleName">ModuleName</a></dt><dd class="doc"><p>Import alias, e.g. from <code>as M</code> (or <code>Muggle</code> if there is no <code>as</code> clause) </p></dd><dt class="src"><a name="v:is_qual" class="def">is_qual</a> :: <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>Was this import qualified? </p></dd><dt class="src"><a name="v:is_dloc" class="def">is_dloc</a> :: <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></dt><dd class="doc"><p>The location of the entire import declaration </p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ImpDeclSpec" class="caption collapser" onclick="toggleSection('i:ImpDeclSpec')">Instances</p><div id="section.i:ImpDeclSpec" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:ImpDeclSpec">ImpDeclSpec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="RdrName.html#t:ImpDeclSpec">ImpDeclSpec</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ImpItemSpec" class="def">ImpItemSpec</a> </p><div class="doc"><p>Describes import info a particular Name </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ImpAll" class="def">ImpAll</a></td><td class="doc"><p>The import had no import list, or had a hiding list </p></td></tr><tr><td class="src"><a name="v:ImpSome" class="def">ImpSome</a></td><td class="doc"><p>The import had an import list. The <code><a href="RdrName.html#v:is_explicit">is_explicit</a></code> field is <code>True</code> iff the thing was named <em>explicitly</em> in the import specs rather than being imported as part of a <a href="---.html">...</a> group. Consider: </p><pre> import C( T(..) ) </pre><p>Here the constructors of <code>T</code> are not named explicitly; only <code>T</code> is named explicitly. </p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:is_explicit" class="def">is_explicit</a> :: <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:is_iloc" class="def">is_iloc</a> :: <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ImpItemSpec" class="caption collapser" onclick="toggleSection('i:ImpItemSpec')">Instances</p><div id="section.i:ImpItemSpec" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:importSpecLoc" class="def">importSpecLoc</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="SrcLoc.html#t:SrcSpan">SrcSpan</a></p></div><div class="top"><p class="src"><a name="v:importSpecModule" class="def">importSpecModule</a> :: <a href="RdrName.html#t:ImportSpec">ImportSpec</a> -> <a href="Module.html#t:ModuleName">ModuleName</a></p></div><div class="top"><p class="src"><a name="v:isExplicitItem" class="def">isExplicitItem</a> :: <a href="RdrName.html#t:ImpItemSpec">ImpItemSpec</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>