<div class="gmail_quote">On Thu, Jul 1, 2010 at 3:38 AM, Felipe Lessa <span dir="ltr">&lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">On Wed, Jun 30, 2010 at 8:02 PM, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br>
&gt; On Thu, Jul 1, 2010 at 12:03 AM, Milan Straka &lt;<a href="mailto:fox@ucw.cz">fox@ucw.cz</a>&gt; wrote:<br>
</div><div class="im">&gt;&gt; After suggestions by others I am thinking about<br>
&gt;&gt;  data Some elem = Single {-# UNPACK #-} !elem | More (Set elem)<br>
&gt;&gt; or<br>
&gt;&gt;  data Some elem = Single {-# UNPACK #-} !elem | More {-# UNPACK #-} !elem<br>
&gt;&gt; (Some elem)<br>
&gt;<br>
&gt; Unfortunately unpacking doesn&#39;t work for polymorphic fields (the new warning<br>
&gt; for ineffective unpack pragmas in GHC head should warn about this). Given<br>
&gt; this you might as well use a standard list.<br>
<br>
</div>However strictness information does work.  But I don&#39;t know the answer<br>
for the following questions:<br>
<br>
  - Should the elements be strict even while they are not unpacked?<br>
Performance gains?<br>
<br>
  - Should the spine of the list be strict? Performance gains? Space leak gains?<br></blockquote><div><br>In my experience/benchmarks strict spines are faster, probably due to better cache usage as the whole structure is updated at once. All the container data structures use strict spines. <br>

</div><font color="#888888"><br>Johan<br><br></font></div><br>