Implict parameters and monomorphism
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
3 May 2001 12:48:39 GMT
Thu, 03 May 2001 08:07:10 -0400, Lennart Augustsson <lennart@mail.augustsson.net> pisze:
> First, I cannot parse that sentence, but I assume you mean when all
> classes are Prelude classes.
Not only Prelude but the whole Haskell 98 standard library.
> Second, I'm pretty sure we all agreed that this was a silly rule and
> should not be in the Haskell definition. I was certain that that it had
> been removed from the Haskell report, but I guess not.
It was not removed, it's still in
<http://research.microsoft.com/~simonpj/haskell98-revised/>.
So probably it should be removed now: SimonPJ wanted to freeze the
revised report in May.
> Third, moving ii to a different module might still exhibit this problem.
Indeed.
> (I'm not sure how ghc defaults exported definitions.)
I'm sure that it works as it should: they are defaulted according to
visible definitions, to Int or Integer here, and from another module
it is not known that the types have been ambiguous, so constraints
from non-Haskell-98 classes can't stop the defaulting.
This is an argument for removing that part of the defaulting rule.
Or for removing the monomorphism restriction.
Or both.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK