[Haskell-cafe] Rank-2 types and class constraints

2004-12-01 Thread Stefan Holdermans
Hi,
Just out of curiosity (I cannot come up with a practical example):  Why 
doesn't the following piece of code type check in GHC (with 
extensions)?

 foo :: (forall a . (Eq a) = a) - Integer
 foo =  undefined
It seems like the type-class constraint is playing a decisive rôle 
here, since the following does check.

 bar :: (forall a . a) - Integer
 bar =  undefined
TIA,
Stefan
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Rank-2 types and class constraints

2004-12-01 Thread Ralf Laemmel
Hi,
foo _ =  undefined
works fine.
Otherwise the poor little a has no chance to get disambiguated.
... Ambiguous type variable `a' in the top-level constraint ...
Ralf
Stefan Holdermans wrote:
Hi,
Just out of curiosity (I cannot come up with a practical example):  
Why doesn't the following piece of code type check in GHC (with 
extensions)?

 foo :: (forall a . (Eq a) = a) - Integer
 foo =  undefined
It seems like the type-class constraint is playing a decisive rôle 
here, since the following does check.

 bar :: (forall a . a) - Integer
 bar =  undefined
TIA,
Stefan
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-caf
e

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe