#4429: Ability to specify the namespace in mkName
---------------------------------+------------------------------------------
Reporter: reinerp | Owner: reinerp
Type: feature request | Status: new
Priority: normal | Milestone: 7.4.1
Component: Template Haskell | Version: 6.12.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by simonpj):
It looks as if I never implemented the `Just dec` part of `VarI`! It's
not straightforward
* We don't have source-code defintions for imported Ids. They've all
been converted to Core, and even the Core may not be available if the defn
is big.
* In principle we do have source code for local-defined Ids, but at the
moment we don't carry around a mapping from Ids to their definitions.
So currently you always get `Nothing`. I don't want to change that until
it becomes a pressing need for someone, but you are dead right that it
should be documented. Just say "always Nohthing" for now!
For `TyVarI`, the situation is this: there is a lexically-scoped, source-
code type variable name that maps to an internal type variable, of the
sort that appears in types. In principle, you could imagine a system in
which a lexically scoped type varaible maps to a ''type'' not a type
variable:
{{{
f :: Int -> Int
f (x::a) = 3::a
}}}
Here 'a' maps to 'Int'. Now in fact GHC's design insists that source-
language type varaibles map to internal ''variables'', but I didn't want
to bake that in too much. And I'm not certain that I guarantee they map to
''distinct'' type variables.
This is all a bit confusing. I think a better design would indeed
identify these internal and external type variables -- the distinction is
confusing. But it's another swamp I don't want to enter just yet.
Does that help?
Thank you for doing the documentation!
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4429#comment:24>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs