#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 Revisions:

Description

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)

Change History (2)

comment:1 Changed 13 months ago by simonpj

Try with -X NoMonomorphismRestriction?

Simon

comment:2 Changed 13 months ago by j80JjBjVNRMajmA

  • Resolution set to invalid
  • Status changed from new to closed

Ok. Thanks!

Note: See TracTickets for help on using tickets.