Type resolution problem
Marcin 'Qrczak' Kowalczyk
29 May 2001 05:41:19 GMT
Mon, 28 May 2001 17:53:38 -0700, Juan Carlos Arevalo Baeza <firstname.lastname@example.org> pisze:
> Uncommenting the type expression above clears the error.
> But, why can't the compiler deduce it by itself?
Monomorphism restriction strikes again. See section 4.5.5 in the
Haskell 98 Report. A pattern binding without an explicit type signature
is considered monomorphic (must resolve to a simgle non-overloaded
type) and points of usage or defaulting rules for numeric types
determine the type (neither applies here).
IMHO monomorphism restriction should be removed (the case for bindings
of the form var = expr without type signature).
__("< Marcin Kowalczyk * email@example.com http://qrczak.ids.net.pl/
^^ SYGNATURA ZASTĘPCZA