<br><br><div class="gmail_quote">On Fri, Jun 10, 2011 at 12:05 PM, Alexander Solla <span dir="ltr">&lt;<a href="mailto:alex.solla@gmail.com">alex.solla@gmail.com</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 Thu, Jun 9, 2011 at 6:04 PM, Felipe Almeida Lessa <span dir="ltr">&lt;<a href="mailto:felipe.lessa@gmail.com" target="_blank">felipe.lessa@gmail.com</a>&gt;</span> wrote:<br></div><div><div></div><div class="h5">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Something like this?<br>
<br>
  equivalenceClosure = fix $ \f e -&gt;<br>
    let e&#39; = reflexivity . symmetry . transitivity $ e<br>
    in if e&#39; == e then e else f e&#39;<br>
<br>
Cheers,<br>
<br>
--<br>
<font color="#888888">Felipe.<br>
</font></blockquote></div><br></div></div><div><div class="im"><div>I managed something even &quot;clearer&quot;.  I still have very little intuition about what&#39;s going on, but I had an aha moment -- which I promptly forgot :0( -- and at least there&#39;s a mechanical translation from the iterate version to the fix one.</div>

<div><br></div></div><div class="im"><div>equivalenceClosure :: (Ord a) =&gt; Relation a -&gt; Relation a</div></div><div class="im"><div>equivalenceClosure = fix (\f -&gt; reflexivity . symmetry . transitivity)</div></div>
</div>
</blockquote></div><br><div>Cancel that, it&#39;s not passing my tests.</div>