Mentoring for implementing #8004

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mentoring for implementing #8004

David Luposchainsky
Hey Devs,

I haven't worked on GHC before, so I'm having trouble finding an entry
point to implementing the AMP warnings (#8004). I only have a rough
working knowledge of GHC's inner workings, but it would be a shame if
the ticket wasn't resolved until the 7.8 deadline (which is somewhere in
September if I remember it right).
My last approach was grepping through the source for "DEPRECATED" and
seeing whether there would be an appropriate place for these warnings
there, but that wasn't very fruitful.

Long story short: can anyone point me in the right direction? I assume
the right place to look is somewhere in the typechecker where there's a
type class environment, and that's as far as I've come. (It's hard to
understand thousands of lines when you're not even sure you're in the
right place ...)

Greetings,
David



Reply | Threaded
Open this post in threaded view
|

Mentoring for implementing #8004

Richard Eisenberg-2
I haven't played much with instances, but it looks to me like
tcInstDecls1, in typecheck/TcInstDecls.lhs, is a good place. Toward the
end of the body of that function is a bunch of checks in the style that
you will need to write (such as for bogus Typeable instances).

I hope this helps!
Richard

On 2013-07-31 13:56, David Luposchainsky wrote:

> Hey Devs,
>
> I haven't worked on GHC before, so I'm having trouble finding an entry
> point to implementing the AMP warnings (#8004). I only have a rough
> working knowledge of GHC's inner workings, but it would be a shame if
> the ticket wasn't resolved until the 7.8 deadline (which is somewhere
> in
> September if I remember it right).
> My last approach was grepping through the source for "DEPRECATED" and
> seeing whether there would be an appropriate place for these warnings
> there, but that wasn't very fruitful.
>
> Long story short: can anyone point me in the right direction? I assume
> the right place to look is somewhere in the typechecker where there's a
> type class environment, and that's as far as I've come. (It's hard to
> understand thousands of lines when you're not even sure you're in the
> right place ...)
>
> Greetings,
> David
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



Reply | Threaded
Open this post in threaded view
|

Mentoring for implementing #8004

Simon Peyton Jones
In reply to this post by David Luposchainsky
Rather than scatter these AMP checks here and there, I'd suggest adding
        checkAMPStuff tcg_env
on line 206 or so of TcRnDriver, near the call to reportUnusedNames.

This happens after typechecking is complete.  The tcg_env includes all the newly-defined instances (in tcg_insts), what is in scope etc (tcg_rdr_env), so all the stuff you need is to hand.  You can write checkAMPStuff in one place.

Simon

|  -----Original Message-----
|  From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of David
|  Luposchainsky
|  Sent: 31 July 2013 13:57
|  To: ghc-devs at haskell.org
|  Subject: Mentoring for implementing #8004
|  
|  Hey Devs,
|  
|  I haven't worked on GHC before, so I'm having trouble finding an entry
|  point to implementing the AMP warnings (#8004). I only have a rough
|  working knowledge of GHC's inner workings, but it would be a shame if
|  the ticket wasn't resolved until the 7.8 deadline (which is somewhere in
|  September if I remember it right).
|  My last approach was grepping through the source for "DEPRECATED" and
|  seeing whether there would be an appropriate place for these warnings
|  there, but that wasn't very fruitful.
|  
|  Long story short: can anyone point me in the right direction? I assume
|  the right place to look is somewhere in the typechecker where there's a
|  type class environment, and that's as far as I've come. (It's hard to
|  understand thousands of lines when you're not even sure you're in the
|  right place ...)
|  
|  Greetings,
|  David
|  
|  _______________________________________________
|  ghc-devs mailing list
|  ghc-devs at haskell.org
|  http://www.haskell.org/mailman/listinfo/ghc-devs