No warn on type in expression?

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. Tom

On 2015-10-27 04:37 PM, amindfv@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.

Hello, Have a look at: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/other-type-e... TL;DR - pattern type signatures are not the same kind of an animal that declaration signatures are. This kind of an animal has already bitten me in the bottom, so I'm glad I can share the insight :) Best regards, Marcin Mrotek
participants (3)
-
Albert Y. C. Lai
-
amindfv@gmail.com
-
Marcin Mrotek