[GHC] #8998: GHCi infers types that are too restrictive

GHC ghc-devs at haskell.org
Tue Apr 15 16:19:30 UTC 2014


#8998: GHCi infers types that are too restrictive
------------------------------------+-------------------------------------
       Reporter:  j80JjBjVNRMajmA   |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  GHCi              |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 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)
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8998>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list