I think I&#39;ve got something nice in the end.<br><br><a href="http://hpaste.org/41042/classsynonymhs">http://hpaste.org/41042/classsynonymhs</a><br><br>example:<br><br>class&nbsp; (&nbsp;&nbsp;&nbsp; ParteDi (Servizio a) s<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ,&nbsp;&nbsp;&nbsp; Read a<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ,&nbsp;&nbsp;&nbsp; Eq a<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; , &nbsp;&nbsp;&nbsp; Show a<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; , &nbsp;&nbsp;&nbsp; Integer `ParteDi` s<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ) &rArr; SClass s a <br><br>$(classSynonym &#39;&#39;SClass)<br><br>ghci &quot;:i SClass&quot; command is printing some strange type variables but it compiles<br>
<br>paolino<br><br><div class="gmail_quote">2010/11/1 Gábor Lehel <span dir="ltr">&lt;<a href="mailto:illissius@gmail.com">illissius@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Mon, Nov 1, 2010 at 6:09 PM, Christopher Done<br>
&lt;<a href="mailto:chrisdone@googlemail.com">chrisdone@googlemail.com</a>&gt; wrote:<br>
&gt; On 1 November 2010 17:53, Paolino &lt;<a href="mailto:paolo.veronelli@gmail.com">paolo.veronelli@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I&#39;d like to have a template haskell function that take some constraints and<br>
&gt;&gt; a class name and write an empty class from those and relative empty instance<br>
&gt;&gt; to simulate typeclass synonyms.<br>
&gt;&gt;<br>
&gt;&gt; As I&#39;ve never written TH and couldn&#39;t find a easily adaptable code around, I<br>
&gt;&gt; ask here for the code, or some hints on how to arrive there.<br>
&gt;<br>
&gt; I took Justin Bailey&#39;s haskelldb-th library as a TH example to work<br>
&gt; from and rewrote one TH function to try my hand at it, it&#39;s quite easy<br>
&gt; to follow with a simple example:<br>
&gt;<br>
&gt; <a href="http://hpaste.org/paste/41035/demo" target="_blank">http://hpaste.org/paste/41035/demo</a><br>
&gt;<br>
&gt; Maybe this is enough example to get you going. The rest you can find<br>
&gt; syntax parts from the TH Haddock documentation.<br>
<br>
</div></div>A useful FYI: the API docs are (almost) completely devoid of comments,<br>
but if you click to see the source, it does have some additional<br>
information in comments there, just not Haddock-formatted.<br>
<br>
<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Work is punishment for failing to procrastinate effectively.<br>
</font></blockquote></div><br>