
27 Apr
2006
27 Apr
'06
12:01 a.m.
This code compiles properly (with -fglasgow-exts on GHC 6.4.1): class CC a type C x = CC a => a x f, g :: C a -> Int f _ = 3 g x = f x But, this code: class CC a type C x = CC a => a x f, g :: C a -> Int f _ = 3 g x = f $ x -- the only change gives this error: Inferred type is less polymorphic than expected Quantified type variable `a' escapes Expected type: a a1 -> b Inferred type: C a1 -> Int In the first argument of `($)', namely `f' In the definition of `g': g x = f $ x What's going on here? -- Robin Bate Boerop