1 module ShouldSucceed where
3 --!!! monomorphism restriction and defaulting
10 Hugs 1.4 complains: ERROR "Strange.hs" (line 3): Int is not an
11 instance of class "Fractional". GHC however compiles the program.
12 Substitute for x and Hugs is happy. What's going on?
14 I haven't studied the numeric classes much so perhaps I'm missing
15 something obvious here. (I see that the bugs page alludes to some 1.4
16 features not in Hugs leading to type errors. If this is it, maybe you
17 should give it as an example?)
23 Date: Wed, 25 Feb 98 14:01:35 -0500
24 From: "John C. Peterson" <peterson-john@CS.YALE.EDU>
25 To: bjartem@idi.ntnu.no
26 cc: hugs-bugs@CS.YALE.EDU
27 Subject: Re: Fractional and Int?
29 This is a known hugs bug. x should be monomorphic, allowing the usage
30 in main to constrain it to Fractional. Instead, it is generalized and
31 then defaulted to Int without being influenced by main. So ghc is
32 right and hugs is wrong on this one. I expect this will be fixed