RE: incompatible signatur syntax within instance definition

2003-12-15 Thread Simon Peyton-Jones
| This is legal in Haskell 98, because the `a' in the inner declaration is | implicitly universally quantified. But if the scope of the outer type | variable `a' extends over the inner type declaration, then the inner `a' | will not be locally universally quantified, and the call to `bar' will |

Re: incompatible signatur syntax within instance definition

2003-12-10 Thread Christian Maeder
Fergus Henderson wrote: Allowing repeated constraints would not be sufficient for that. Yes, you're right. A true (but senseless) constraint like "Show Int" is rejected as well. (The same applies to "Show a" if "a" is a scoped type variable, that is when "a" is monomorph.) So a function with t

Re: incompatible signatur syntax within instance definition

2003-12-10 Thread Fergus Henderson
On 09-Dec-2003, Christian Maeder <[EMAIL PROTECTED]> wrote: > Fergus Henderson wrote: > >Or were you referring to the fact that variables which are already > >constrained can't be constrained again? IMHO that is a feature too. > >It doesn't make sense to constrain a variable at any point other tha

Re: incompatible signatur syntax within instance definition

2003-12-09 Thread Christian Maeder
Fergus Henderson wrote: Or were you referring to the fact that variables which are already constrained can't be constrained again? IMHO that is a feature too. It doesn't make sense to constrain a variable at any point other than the point where that variable is introduced. Indeed, repeating a cons

Re: incompatible signatur syntax within instance definition

2003-12-09 Thread Fergus Henderson
On 08-Dec-2003, Christian Maeder <[EMAIL PROTECTED]> wrote: > Fergus Henderson wrote: > >I think the issue here is that in ghc (with -fglasgow-exts), > >the "a" here refers to the same type variable "a" in the > >top of the instance declaration, which has already been > >constained, and cannot be c

Re: incompatible signatur syntax within instance definition

2003-12-08 Thread Malcolm Wallace
Christian Maeder <[EMAIL PROTECTED]> writes: > Fergus Henderson wrote: > > I think the issue here is that in ghc (with -fglasgow-exts), > > the "a" here refers to the same type variable "a" in the > > top of the instance declaration, which has already been > > constained, and cannot be constrained

Re: incompatible signatur syntax within instance definition

2003-12-08 Thread Christian Maeder
Fergus Henderson wrote: I think the issue here is that in ghc (with -fglasgow-exts), the "a" here refers to the same type variable "a" in the top of the instance declaration, which has already been constained, and cannot be constrained again. Is that a bug or a feature? With Haskell 98, it is a fr