-
-
Notifications
You must be signed in to change notification settings - Fork 199
Description
The years in leap_test.hs have no explicit type, allowing solutions with differente type signatures:
isLeapYear :: Int -> Bool
isLeapYear :: Integer -> BoolThis is desirable, but has the unintended effect of displaying a warning...
Defaulting the following constraint(s) to type `Integer` arising from the use of `isLeapYear` at leap_test.hs ... arising from the literal 1996 ...
... when compiling leap_test.hs with the most general solution:
isLeapYear :: Integral a => a -> BoolIt's important to supress this warning so we don't misguide newcomers in thinking that there is something wrong with their code, when the problem is in the test module. Also, using the most general type is usually encouraged in Haskell.
I don't think it's possible to write a test allowing those three distinct signatures without raising a warning, so I propose to suppress it with:
{-# OPTIONS_GHC -fno-warn-type-defaults #-}I could make a pull request for leap and maybe other exercises sharing the same problem, but I haven't checked yet how many they are.
Anyone against it?