« Return to Thread: MPTCs and rigid variables

Re: MPTCs and rigid variables

by David House :: Rate this Message:

Reply to Author | View in Thread

On 06/03/07, Simon Peyton-Jones <simonpj@...> wrote:
> I'm not against adding "type is too monomorphic" or something like that if you think it'd help, but I'd like to say something about the incompatibility of 'a' and 'Int'.  No?

Here's a proper draft, then.

Foo.hs:
foo :: [a] -- line 1
foo = "hello" -- line 2

Error message:
Inferred type is not as polymorphic as type signature claims.
  Inferred type: [Char]
  Expected type: [a]
    Provided by the type signature:
      foo :: [a]
    at ~/foo.hs:1
(`a', a polymorphic type variable, could not be unified with `Char', a
monotype.)
In the expression: "hello" at ~/foo.hs:1:8
In the definition of `foo': foo = "hello"

How's that sound?

--
-David House, dmhouse@...
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

 « Return to Thread: MPTCs and rigid variables