[Haskell-cafe] No warn on type in expression?

Albert Y. C. Lai trebla at vex.net
Wed Oct 28 21:31:52 UTC 2015

On 2015-10-27 04:37 PM, amindfv at gmail.com wrote:
> An expression like:
> x = 5 :: Int
> Fails with -Wall -Werror, with "Top-level binding with no type signature". I propose we don't warn on bindings whose entire expressions are typed. This cuts in half the line noise for trivial variable values.

This will surprise you:

module F where
x = 5 :: Num a => a

This does not make x polymorphic.

Type annotation on RHS does not do the same thing as type signature for 
variable name.

If you don't accept this, join the Haskell Prime committee or talk to 
someone who does.

More information about the Haskell-Cafe mailing list