On Wed, Aug 29, 2007 at 08:42:57AM +0100, Simon Peyton-Jones wrote:
> | > How much is this style of name shadowing used in GHC? Do people think it
> | > is desirable?
> |
> | Personally I like to use shadowing and I think -fwarn-name-shadowing is
> | overkill, but there are cases where it can catch real bugs. Take this as a
> | vote against rather than a veto; I'll go with the majority.
>
> Me too. It is often useful, esp in a monadic context. Indeed it can *save*
> errors by not allowing you to refer to an out-of-date binding.
This is often caught by unused variable warnings, but I take your point.
Maybe we should have a separate -fwarn-do-name-shadowing (or some better
name) flag?
> So we want each GHC module to explicitly declare what warnings it should be
> free of. We can either do that by
> -Wall -fno-warn-name-shadowing -fno-whatever
> or
> -W -fwarn-whatever
>
> Which do you think is best?
I prefer -Wall -fno-warn-name-shadowing; I'm sure it'll be shorter, and
it will automatically gain any new warnings.
I think it would be better to put that in the Makefile and initially add
"{-# OPTIONS_GHC -w #-}" to every module; then work towards removing the
pragmas so the warnings are only set in one place.
Thanks
Ian
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc