Tue, 05 Feb 2002 11:22:18 -0800
> My questiona are: Were the designers of the implicit
> parameters paper aware of this problem when they wrote the
> paper? If so, they probably did not think this was a big
> problem. Do people in general think this is a problem?
We certainly were aware. It is a problem, and a big one. The monomorphism
restriction (MR) was (barely) acceptable in Haskell 98 because at least the
final value returned by the program was not changed by this kludge kicking
in. But, as we point out in the paper, implicit parameters and the MR are
simply incompatible. One of them has to go.
As John Hughes intimated, this debate is part of a much larger issue as to
how Haskell handles type schemes versus types, and implicit parameters show
that type schemes can arise from causes other than polymorphism.
In the long term, should Haskell maintain a distinction between types and
type schemes? Between call-by-name and call-by-need? Should type schemes be
permitted everywhere? If so, should inference do it's best and simply report
when ambiguities arise? Etc. etc.
I think the time has come for us to address these types of questions from a
fundamental basis, not simply as fixes to the existing infrastructure.
Otherwise we'll never be able to budge from the sludge of the kludge...