Hello,<div><br></div><div><div class="gmail_quote">On Mon, Feb 13, 2012 at 5:32 PM, Edward Kmett <span dir="ltr">&lt;<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>There are fewer combinators from commonly used classes for working with the left argument of a bifunctor, however.</div></div></blockquote></div><br></div><div>I think that the bifunctor part of Bas&#39;s version is a bit of a red herring.  What I like about it is that it overloads exactly what needs to be overloaded---the representation of the type---without the need for any fake parameters.  To make things concrete, here is some code:</div>
<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">&gt; newtype TypeRepT t = TR TypeRep</font></div><div><font face="&#39;courier new&#39;, monospace">&gt; </font></div>
<div><font face="&#39;courier new&#39;, monospace">&gt; class Typeable t where</font></div><div><font face="&#39;courier new&#39;, monospace">&gt;   typeRep :: TypeRepT t</font></div><div><font face="&#39;courier new&#39;, monospace">&gt;</font></div>
<div><font face="&#39;courier new&#39;, monospace">&gt; instacne Typeable Int where typeRep = TR type_rep_for_int</font></div><div><font face="&#39;courier new&#39;, monospace">&gt; instance Typeable []  where typeRep = TR type_rep_for_list</font></div>
<br>The two formulations support exactly the same interface (you can define `Proxy` and the proxied `typeRep` in terms of this class) so I wouldn&#39;t say that the one is easier to use that the other, but I think that this formulation is slightly simpler because it avoids the dummy parameter to typeRep.<div>
<br></div><div>-Iavor<br><div><div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><br></div></div></div>