Opened 3 years ago

Closed 3 years ago

#8998 closed bug (invalid)

GHCi infers types that are too restrictive

Reported by: j80JjBjVNRMajmA Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.6.3
Keywords: Cc: hvr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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:

  :: (Integer -> Integer -> Double,
      Integer -> Integer -> GHC.Real.Ratio Integer,
      Integer -> Integer)

The correct output should be:

 :: (Fractional c, Fractional c1, Num a) =>
     (Integer -> Integer -> c, Integer -> Integer -> c1, Integer -> a)

Change History (2)

comment:1 Changed 3 years ago by simonpj

Try with -X NoMonomorphismRestriction?


comment:2 Changed 3 years ago by j80JjBjVNRMajmA

Resolution: invalid
Status: newclosed

Ok. Thanks!

Note: See TracTickets for help on using tickets.