<div class="gmail_quote">From a previous email in the beginners list I more or less understood that the monomorphism restriction will not exist anymore in Haskell Prime.</div><div class="gmail_quote"><br></div><div class="gmail_quote">
Is this correct?</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Mar 27, 2009 at 10:32 PM, Jonathan Cast <span dir="ltr">&lt;<a href="mailto:jonathanccast@fastmail.fm">jonathanccast@fastmail.fm</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Fri, 2009-03-27 at 14:26 -0700, Kirk Martinez wrote:<br>
&gt; Your powersOfTwo function, since it gets memoized automatically (is<br>
&gt; this the case for all functions of zero arguments?),<br>
<br>
</div>It is the case for all functions which have zero arguments *at the time<br>
they are presented to the code generator*.  The infamous evil<br>
monomorphism restriction arises from the fact that overloaded<br>
expressions, such as<br>
<br>
    negative_one = exp(pi * sqrt(-1))<br>
<br>
look like functions of zero arguments, but are not, and hence do not get<br>
memoized.  This behavior was considered sufficiently surprising, when it<br>
was discovered in early Haskell compilers, that the construct was<br>
outlawed from the language entirely.<br>
<br>
jcc<br>
<div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>