Need help interpreting renamer trace output

Dear GHC-ers, I'm looking into the inerts of the renamer and I'm trying to get a feel for where things are bound. I thought it would be useful to have a look at how the renamer works on something known, so I compiled the following program (with HEAD): class Foo x where type FooTy x y foo :: x t -> FooTy x t instance Foo [] where type FooTy [] a = a foo (x:xs) = x main = print "Done" In the output of -ddump-rn-trace, I see this around the declaration of the class Foo: bhtv [x, y] [] ([(v1A, x), (v1C, y)], [(afy, x), (afz, y)]) bhtv [t] [] ([(v1A, x), (vjW, t)], [(afy, x), (afA, t)]) rnTycl [(class Foo x where type family FooTy x y foo :: x t -> FooTy x t, [(rfv, FooTy)])] [REC class Foo x where type family FooTy x y foo :: x t -> FooTy x t] I had expected that the 'x' and 'y' would have had the same uniques. The last tuple of bhtv is a LocalRdrEnv, which is (OccEnv Name, NameSet). Can someone explain to me the uses of both of these parts and why the names mentioned in each have different uniques? Regards, Philip

Erratum; Of course, I meant that I had expected the different occurrences of 'x' to have the same uniques. Similarly, the different occurrences of 'y'. I did *not* expect 'x' and 'y' to have the same uniques. Ph. On Wed, 2013-03-06 at 10:18 +0100, Philip K.F. Hölzenspies wrote:
Dear GHC-ers,
I'm looking into the inerts of the renamer and I'm trying to get a feel for where things are bound. I thought it would be useful to have a look at how the renamer works on something known, so I compiled the following program (with HEAD):
class Foo x where type FooTy x y foo :: x t -> FooTy x t instance Foo [] where type FooTy [] a = a foo (x:xs) = x
main = print "Done"
In the output of -ddump-rn-trace, I see this around the declaration of the class Foo:
bhtv [x, y] [] ([(v1A, x), (v1C, y)], [(afy, x), (afz, y)]) bhtv [t] [] ([(v1A, x), (vjW, t)], [(afy, x), (afA, t)]) rnTycl [(class Foo x where type family FooTy x y foo :: x t -> FooTy x t, [(rfv, FooTy)])] [REC class Foo x where type family FooTy x y foo :: x t -> FooTy x t]
I had expected that the 'x' and 'y' would have had the same uniques. The last tuple of bhtv is a LocalRdrEnv, which is (OccEnv Name, NameSet). Can someone explain to me the uses of both of these parts and why the names mentioned in each have different uniques?
Regards, Philip
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Try -ddump-rn -dppr-debug. Then you see all the unique. In the class decls, all the occurrences of x have the same unique, don't they? Ditto in the instance decl. So I don't understand your qn, sorry Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Philip K.F. Hölzenspies | Sent: 06 March 2013 10:29 | To: glasgow-haskell-users@haskell.org | Subject: Re: Need help interpreting renamer trace output | | Erratum; Of course, I meant that I had expected the different | occurrences of 'x' to have the same uniques. Similarly, the different | occurrences of 'y'. I did *not* expect 'x' and 'y' to have the same | uniques. | | Ph. | | | | On Wed, 2013-03-06 at 10:18 +0100, Philip K.F. Hölzenspies wrote: | > Dear GHC-ers, | > | > I'm looking into the inerts of the renamer and I'm trying to get a feel | > for where things are bound. I thought it would be useful to have a look | > at how the renamer works on something known, so I compiled the following | > program (with HEAD): | > | > | > class Foo x where | > type FooTy x y | > foo :: x t -> FooTy x t | > instance Foo [] where | > type FooTy [] a = a | > foo (x:xs) = x | > | > main = print "Done" | > | > | > In the output of -ddump-rn-trace, I see this around the declaration of | > the class Foo: | > | > bhtv [x, y] | > [] | > ([(v1A, x), (v1C, y)], [(afy, x), (afz, y)]) | > bhtv [t] | > [] | > ([(v1A, x), (vjW, t)], [(afy, x), (afA, t)]) | > rnTycl [(class Foo x where | > type family FooTy x y | > foo :: x t -> FooTy x t, | > [(rfv, FooTy)])] | > [REC | > class Foo x where | > type family FooTy x y | > foo :: x t -> FooTy x t] | > | > | > I had expected that the 'x' and 'y' would have had the same uniques. The | > last tuple of bhtv is a LocalRdrEnv, which is (OccEnv Name, NameSet). | > Can someone explain to me the uses of both of these parts and why the | > names mentioned in each have different uniques? | > | > Regards, | > Philip | > | > | > | > | > _______________________________________________ | > Glasgow-haskell-users mailing list | > Glasgow-haskell-users@haskell.org | > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users | | | | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (2)
-
Philip K.F. Hölzenspies
-
Simon Peyton-Jones