The intention is that it should be straightforward to suppress warnings.

Warning about defaulting is important, because it's a place where a silent 
choice affects the dynamic semantics of your program.  You can suppress the 
warning by supplying a type signature.  In your example:

| > main =
| >    let r = pi :: Double
| >        x = r ^ (3 :: Int)
| >        y = r ^ 3
| >        z = r Prelude.^ 3
| >    in  putStrLn $ show (x,y,z)

Simply add a type signature for 'z', or for the naked 3 in z's definition.

I think it matters what type is chosen, because it affects the output of the 
program; it's good practice to be explicit about what type you want, at each 
site where defaulting is applied.  If your idea of good practice differs from 
mine, then you can record your choice by using -fno-warn-type-defaults.

Simon
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to