<div class="gmail_quote">On Fri, Jul 9, 2010 at 11:56 AM, Milan Straka <span dir="ltr">&lt;<a href="mailto:fox@ucw.cz">fox@ucw.cz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi all,<br>
<br>
for my work on the containers I need to settle some questions about strictness.<br>
Thank you very much for your opinions.<br>
<br>
Discussion ends: 23. July 2010.<br>
<br>
1) Strictness of keys and values in the datatype.<br>
<br>
Currently we have the following strictness flags in the datatypes:<br>
- IntMap: !key value<br>
- IntSet: !key<br>
- Map: !key value<br>
- Set: key<br>
<br>
I vote for changing Set to store keys also strict.<br>
<br>
Storing values as nonstrict probably makes sense.<br>
<br>
2) Strictness of keys and values in the method definitions.<br>
<br>
The IntMap.lookup (lookup k t = ... seq k ...) evaluates the given key<br>
even if it is not needed (when searching empty tree). Some methods are<br>
more carefull.<br>
<br>
I vote for all IntMap, IntSet, Map and Set methods that are given a key<br>
value (insert, delete, member, ...) to be strict in the keys. This<br>
a) would be consistent with 1)<br>
b) would be a bit more efficient (~5% in the IntMap.lookup case)<br>
<br>
3) Strict folds<br>
<br>
Currently there are no strict folds.<br>
<br>
I vote for adding strict folds (fold&#39;, foldWithKey&#39; when appropriate) to<br>
all Map, Set, IntMap, IntSet.<br></blockquote><div><br></div><div>I agree on all points. I&#39;ve looked into the core generated for lookup, insert, etc and it looks better when the key is strict. It&#39;s hard to actually make use of the fact that some function aren&#39;t strict in the key, as they are only non-strict in the case of an empty data structure (so they&#39;re conditionally non-strict).</div>

<div><br></div><div>Johan</div><div> </div></div>