GHCi infers types that are too restrictive
If the following is loaded into ghci:
import Data.Function
test1 = (/) `on` fromInteger
test2 = (/) `on` fromInteger
asd = test2 1 2 :: Rational
test3 = fromInteger
I get the following types:
(test1,test2,test3)
:: (Integer -> Integer -> Double,
Integer -> Integer -> GHC.Real.Ratio Integer,
Integer -> Integer)
The correct output should be:
(test1,test2,test3)
:: (Fractional c, Fractional c1, Num a) =>
(Integer -> Integer -> c, Integer -> Integer -> c1, Integer -> a)
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | hvr |
Operating system | |
Architecture |