<html><head></head><body bgcolor="#FFFFFF"><div>That's an interesting idea, thanks.<br><br>Отправлено с iPad</div><div><br>08.05.2012, в 23:31, Daniel Peebles &lt;<a href="mailto:pumpkingod@gmail.com">pumpkingod@gmail.com</a>&gt; написал(а):<br><br></div><div></div><blockquote type="cite"><div>To expand on that, this class basically allows you to prove your relation <font face="'courier new', monospace">c</font> holds pointwise across arbitrary binary trees, represented by nested tuples and terminated by ()s. If individual instances of the class had additional ways of constructing values (i.e., proving the relation for the two type parameters), then your trees could contain other types.<div>
<br></div><div>For example, if you had another type</div><div><br></div><div><font face="'courier new', monospace">data Iso a b = Iso (a -&gt; b) (b -&gt; a) -- the functions must be inverses</font></div><div><br>
</div><div>you could write an instance of Something for Iso and build a proof that <font face="'courier new', monospace">((), (a, ((), b))</font> is isomorphic to&nbsp;<font face="'courier new', monospace">((), (c, ((), d))</font>&nbsp;given <font face="'courier new', monospace">Iso a c</font> and <font face="'courier new', monospace">Iso b d</font> using your class.<br>
<div><br></div><div>I'm not sure I'd bundle the two parts together, but I'd call your <font face="'courier new', monospace">pair</font> method (or the class it lives in) something like congruent or ProductsRespectThisRelation :)</div>
<div><br></div><div>Dan</div><div><br></div><div><div class="gmail_quote">On Tue, May 8, 2012 at 3:15 PM, Daniel Peebles <span dir="ltr">&lt;<a href="mailto:pumpkingod@gmail.com" target="_blank">pumpkingod@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">FullBinaryTreeRelation? :P<br><br><div class="gmail_quote"><div class="im">On Tue, May 8, 2012 at 1:36 PM, MigMit <span dir="ltr">&lt;<a href="mailto:miguelimo38@yandex.ru" target="_blank">miguelimo38@yandex.ru</a>&gt;</span> wrote:<br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi café, a quick question.<br>
<br>
Is there a somewhat standard class like this:<br>
<br>
class Something c where<br>
 &nbsp; &nbsp;unit :: c () ()<br>
 &nbsp; &nbsp;pair :: c x y -&gt; c u v -&gt; c (x, u) (y, v)<br>
<br>
?<br>
<br>
I'm using it heavily in my current project, but I don't want to repeat somebody else's work, and it seems general enough to be defined somewhere; but my quick search on Hackage didn't reveal anything.<br>


<br>
I know about arrows; this, however, is something more general, and it's instances aren't always arrows.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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>
</blockquote></div></div></div><br>
</blockquote></div><br></div></div>
</div></blockquote></body></html>