I think I'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 ( ParteDi (Servizio a) s<br> , Read a<br>
, Eq a<br> , Show a<br> , Integer `ParteDi` s<br> ) ⇒ SClass s a <br><br>$(classSynonym ''SClass)<br><br>ghci ":i SClass" 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"><<a href="mailto:illissius@gmail.com">illissius@gmail.com</a>></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>
<<a href="mailto:chrisdone@googlemail.com">chrisdone@googlemail.com</a>> wrote:<br>
> On 1 November 2010 17:53, Paolino <<a href="mailto:paolo.veronelli@gmail.com">paolo.veronelli@gmail.com</a>> wrote:<br>
>> I'd like to have a template haskell function that take some constraints and<br>
>> a class name and write an empty class from those and relative empty instance<br>
>> to simulate typeclass synonyms.<br>
>><br>
>> As I've never written TH and couldn't find a easily adaptable code around, I<br>
>> ask here for the code, or some hints on how to arrive there.<br>
><br>
> I took Justin Bailey's haskelldb-th library as a TH example to work<br>
> from and rewrote one TH function to try my hand at it, it's quite easy<br>
> to follow with a simple example:<br>
><br>
> <a href="http://hpaste.org/paste/41035/demo" target="_blank">http://hpaste.org/paste/41035/demo</a><br>
><br>
> Maybe this is enough example to get you going. The rest you can find<br>
> 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>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org">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>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Work is punishment for failing to procrastinate effectively.<br>
</font></blockquote></div><br>