Hi all,
When compiling the Data.Generics.Basics library module to External
Core, the resulting .hcr file includes the following data declaration:
%data base:DataziGenericsziBasics.ZCTData a =
{base:DataziGenericsziBasics.ZCDData (^base:DataziTypeable.ZCTTypeable
a)
(%forall (c::(*->*)) .
(%forall a b . base:DataziGenericsziBasics.ZCTData
a
->
c (a -> b) ->
a -> c b)
->
(%forall g . g -> c g) -> a -> c a)
[remainder of type snipped to prevent brain damage]
}
The point to notice is that the outer declaration of the tyvar "a" (as
an argument to ZCTData) is shadowed by the inner forall binding of a.
The External Core document says External Core doesn't allow name
shadowing in either terms or types. So I thought about modifying the
External Core printer within GHC to uniquely rename types, but that
would be tedious; instead, I'm inclined to just change the
documentation to say that name shadowing is allowed in types but not
in terms. Before I do that, though, I thought I would ask: Is type
variable name shadowing supposed to be allowed in internal Core? Or
does this reflect a bug in GHC?
Cheers,
Tim
--
Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt
"and there's too much darkness in an endless night to be afraid of the
way we feel" -- Bob Franke
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc