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



_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to