[Haskell-cafe] RE: No warning in GHC

Simon Peyton-Jones simonpj at microsoft.com
Mon Mar 22 04:47:50 EDT 2010


[Redirecting to haskell-cafe]

Try

http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#id2959068

With -Wall I get

bash-3.2$ ghc -c -Wall Foo.hs

Foo.hs:3:0:
    Warning: Definition but no type signature for `func'
             Inferred type: func :: forall t t1. (Num t1) => t -> t1

Foo.hs:3:5: Warning: Defined but not used: `x'

Foo.hs:4:10:
    Warning: This binding for `x' shadows the existing binding
               bound at Foo.hs:3:5

| -----Original Message-----
| From: cvs-ghc-bounces at haskell.org [mailto:cvs-ghc-bounces at haskell.org] On Behalf Of
| Grigory Sarnitskiy
| Sent: 21 March 2010 19:37
| To: cvs-ghc at haskell.org
| Subject: No warning in GHC
| 
| Hello! I wonder, why GHC shows no warning in situations like
| 
| func x = x
|     where x = 5
| 
| Sometimes I forget about argument names used, and use the same names in let or where.
| And it can take me quite a lot time to understand what is wrong. I think it would be
| nice to warn users if the argument is "redefined" in let/where clause. Shall I report
| a bug/feature request? I'm using ghc 6.10.4.
| 
| btw, I couldn't post to IRC: #ghc :Cannot send to channel
| 
| _______________________________________________
| Cvs-ghc mailing list
| Cvs-ghc at haskell.org
| http://www.haskell.org/mailman/listinfo/cvs-ghc



More information about the Haskell-Cafe mailing list