<div>Thank you, good response!</div><div> </div><div>Anyway, I&#39;m not specially aware about the speed in that section of the program. The really big work is done in other places. Also, addOc runs in lists of 300~400 as maximum (but only in special inputs, average is under 200), so the time difference can&#39;t be improved notoriously, and I won&#39;t see changes in performance.</div>
<div> </div><div>But I will follow your pointers when necessary in the future.<br></div><div class="gmail_quote">On Sun, Oct 23, 2011 at 7:50 PM, Daniel Fischer <span dir="ltr">&lt;<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div class="im">On Sunday 23 October 2011, 19:33:55, Daniel Díaz Casanueva wrote:<br>

&gt; Hi, cafe!<br>
&gt;<br>
&gt; I wrote a program and had the following message while compiling (with<br>
&gt; -O2):<br>
&gt;<br>
&gt; SpecConstr<br>
&gt;     Function `addOc{v s6RL} [lid]&#39;<br>
&gt;       has four call patterns, but the limit is 3<br>
&gt;     Use -fspec-constr-count=n to set the bound<br>
&gt;     Use -dppr-debug to see specialisations<br>
&gt;<br>
&gt; What it means? Is it bad? It only happens when compiling with -O2.<br>
<br>
</div>It&#39;s nothing serious.<br>
It&#39;s just a message (that accidentally was output by default in the 7.0.*<br>
series) that the spec-constr pass could have done more specialising, but<br>
the limit forbade it.<br>
<br>
More specialising on constructors means<br>
<br>
- certainly bigger code<br>
- potentially faster code<br>
<br>
but it could also become slower (most likely because of worse cache<br>
locality).<br>
<br>
It&#39;s not even a warning, just a notification.<br>
<div class="im"><br>
&gt;<br>
&gt; addOc is a local function (defined in a where clause). If it helps, here<br>
&gt; is the definition:<br>
&gt;<br>
&gt; addOc x [] = [(x,1)]<br>
&gt; addOc x ((y,n):ys) = if x == y then (y,n+1) : ys<br>
&gt;                                else (y,n) : addOc x ys<br>
&gt;<br>
&gt; I want to know if there is something wrong or a I don&#39;t need to take<br>
&gt; care about this.<br>
<br>
</div>You need not take care of it, but you can try out and pass<br>
-fspec-constr-count=N<br>
on the command line (here, N = 4 is a good start) to see if the generated<br>
code is faster.<br>
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt; Daniel Díaz.<br>
<br>
</div></div></blockquote></div><br>