hugs type inference

Hi, Hugs leaves an odd context when showing the type of the following expression. Is this a bug or just a harmless flaw? Christian Hugs.Base> :t toRational 1 / 2 toRational 1 / 2 :: Real a => Ratio Integer ghci yields: Prelude> :t toRational 1 / 2 <interactive>:1:0: Warning: Defaulting the following constraint(s) to type `Integer' `Real a' arising from use of `toRational' at <interactive>:1:0-9 In the first argument of `(/)', namely `toRational 1' toRational 1 / 2 :: Rational

On Thu, Oct 27, 2005 at 11:02:48PM +0200, Christian Maeder wrote:
Hugs.Base> :t toRational 1 / 2 toRational 1 / 2 :: Real a => Ratio Integer
ghci yields: Prelude> :t toRational 1 / 2
<interactive>:1:0: Warning: Defaulting the following constraint(s) to type `Integer' `Real a' arising from use of `toRational' at <interactive>:1:0-9 In the first argument of `(/)', namely `toRational 1' toRational 1 / 2 :: Rational
They're both telling you the same thing: 1 :: Num a => a toRational 1 :: Real a => Rational toRational 1 / 2 :: Real a => Rational GHCi shows the type after defaulting; Hugs shows the type before, but this can be changed with the +T option.
participants (2)
-
Christian Maeder
-
Ross Paterson