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

#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

#8998: GHCi infers types that are too restrictive -------------------------------------+------------------------------------ Reporter: j80JjBjVNRMajmA | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Try with `-X NoMonomorphismRestriction`? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8998#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8998: GHCi infers types that are too restrictive -------------------------------------+------------------------------------ Reporter: j80JjBjVNRMajmA | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by j80JjBjVNRMajmA): * status: new => closed * resolution: => invalid Comment: Ok. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8998#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC