The dreaded M-R

Andrew Pimlott andrew at
Mon Jan 30 19:37:15 EST 2006

On Tue, Jan 31, 2006 at 12:57:18AM +0100, lennart at wrote:
> Quoting Andrew Pimlott <andrew at>:
> >On Mon, Jan 30, 2006 at 11:06:29PM +0100, lennart at wrote:
> >>So I envisage that you'd turn off the warning in the same way as
> >>you turn off the M-R today: by a type signature.
> >
> >But if people were happy adding type signatures for every polymorphic
> >variable definition, they wouldn't be moving to eliminate the M-R, would
> >they?  Or do I misunderstand?
> Well, my feeling is that the M-R is an ugly wart, and I want it gone.
> But I'm still happy to put a type signature when I want something to
> be polymorphic.

Ok, I understand your position now.  But even given this view, I think
the warning will be problematic.  First, when will the warning be
emitted?  For all variable assignments without signatures, or only for
those that the implementation fails to monomorphize (as an
optimization)?  The first is heavy-handed; the second, obviously
implementation-dependent (someone using another implementation, or
another optimization level, will get the warning and will lose sharing).
Second, a warning about "loss of sharing" may befuddle beginners (who
are usually not taught to write type signatures at the start).

Well, maybe when someone implements this warning, we will find out I'm
wrong and it doesn't cause trouble.   And I agree with removing the M-R,
with or without the warning.


More information about the Haskell-prime mailing list