| 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
|
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
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
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
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
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
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