Scoped type variables
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
8 May 2001 16:32:53 GMT
Tue, 8 May 2001 08:25:39 -0700, Simon Peyton-Jones <simonpj@microsoft.com> pisze:
> I was meaning in the translation into System F of the program.
[...]
Ah, OK, sorry.
More strange behavior of Hugs (none of this is allowed by ghc):
\(x :: a) (y :: b) -> x+y -- not allowed
\(x :: a) -> \(y :: b) -> x+y -- allowed
f :: Int->Int->Int; f x = \(y::a) -> x+y -- not allowed
f :: Int->Int->Int; f = \x (y::a) -> x+y -- allowed
I guess that the constraint that a type is not more specific than a
pattern type signature tells is checked once at some point of time. It
is rejected only when the type inference determined the more specific
type before this check was performed, but it might be determined later
which is not caught. I would remove the check altogether.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK