All warnings but type signatures

Is there a way to enable all warnings but the following: Hope/Item/DBDesc.hs:6:0: Warning: Definition but no type signature for `item_db' Overall, is there an advantage to type signatures in GHC as opposed to letting the compiler derive them? Thanks, Joel -- http://wagerlabs.com/

On Sun, 2007-05-13 at 14:23 +0100, Joel Reymont wrote:
Is there a way to enable all warnings but the following:
Hope/Item/DBDesc.hs:6:0: Warning: Definition but no type signature for `item_db'
See the users guide section on warnings: http://haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#id31... Try turning on most (-W) or all (-Wall) warning and turning off the warning for missing type signatures (-fno-warn-missing-signatures).
Overall, is there an advantage to type signatures in GHC as opposed to letting the compiler derive them?
Yes. It helps in thinking about the code. I often design by starting with just type signatures and data type definitions. It also helps enormously with finding the reasons for type errors. It also serves as documentation for yourself and other readers of your code. Constraining types of functions can often help performance too, for example if you don't need some function to be overloaded for all numeric types then you can constrain it to be Int for example. Duncan

For me the type is important, I want to see it for every top level function. Using named types it serves as documentation. -- Lennart On Sun, 13 May 2007, Joel Reymont wrote:
Date: Sun, 13 May 2007 14:23:42 +0100 From: Joel Reymont
To: GHC Users Mailing List Subject: All warnings but type signatures Is there a way to enable all warnings but the following:
Hope/Item/DBDesc.hs:6:0: Warning: Definition but no type signature for `item_db'
Overall, is there an advantage to type signatures in GHC as opposed to letting the compiler derive them?
Thanks, Joel
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Lennart
participants (3)
-
Duncan Coutts
-
Joel Reymont
-
Lennart Augustsson