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
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
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
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
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:
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.
___
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: