[Haskell-cafe] MPTCs and rigid variables

Iavor Diatchki iavor.diatchki at gmail.com
Sun Mar 4 13:11:21 EST 2007


There is nothing wrong with this program.   I have run into this
problem and I consider it to be a bug/weakness of the type checking
algorithm used by the implementation.

(I also agree with you that the term "rigid variable" is rather
confusing because it is an artifact of the type checking algorithm
used by GHC.)


On 3/3/07, David House <dmhouse at gmail.com> wrote:
> class Foo a b | a -> b
> instance Foo Int String
> bar :: Foo Int b => b
> bar = "rargh"
> Is there any reason why that shouldn't work? GHC gives one of its
> silly "b is a rigid variable" errors (aside: that's a really confusing
> error; I'd prefer something like Hugs's "Infered type is not general
> enough").
> --
> -David House, dmhouse at gmail.com
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list