Re: Error when ($) is used, but no error without

2006-04-27 Thread Niklas Broberg
On 4/27/06, Robin Bate Boerop [EMAIL PROTECTED] wrote: 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 The problem is exactly the use of $. $ is an operator, not a built-in language construct, and it has type (a - b) - a - b. No

Re: Error when ($) is used, but no error without

2006-04-27 Thread Brian Hulley
Niklas Broberg wrote: On 4/27/06, Robin Bate Boerop [EMAIL PROTECTED] wrote: 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 The problem is exactly the use of $. $ is an operator, not a built-in language construct, and it has type (a

Re: Error when ($) is used, but no error without

2006-04-27 Thread Bulat Ziganshin
Hello Robin, Thursday, April 27, 2006, 8:01:16 AM, you wrote: 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

Error when ($) is used, but no error without

2006-04-26 Thread Robin Bate Boerop
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

Re: Error when ($) is used, but no error without

2006-04-26 Thread Brian Hulley
Robin Bate Boerop wrote: 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:

Re: Error when ($) is used, but no error without

2006-04-26 Thread Brian Hulley
Brian Hulley wrote: f,g :: (forall a. CC a = a Int) - Int -- not allowed delete the not allowed comment ;-) It's not so simple as I'd thought so I'd be interested to know the reason for $ making a difference too. Regards, Brian. ___

Re: Error when ($) is used, but no error without

2006-04-26 Thread Brian Hulley
Brian Hulley wrote: Brian Hulley wrote: f,g :: (forall a. CC a = a Int) - Int -- not allowed delete the not allowed comment ;-) It's not so simple as I'd thought so I'd be interested to know the reason for $ making a difference too. Actually I must undelete my not allowed comment above: