Hi all, I think this is the right place for the following questions and I thank beforehand for your answers :-)<div><br><div><br></div><div>I&#39;m experimenting with typeclasses and TH, and I want to define a &#39;macro&#39; that works more or less like this:</div>
<div><br></div><div>Given the name of a typeclass and a function, return the expressions corresponding to the type-annotated instances, for instance</div><div><br></div><div>$(foo Show show)</div><div><br></div><div>should translate to:</div>
<div><br></div><div>[&quot;(show :: Int -&gt; String)&quot;,  &quot;(show :: Bool -&gt; String)&quot;, ....] </div><div><br></div><div>for all instances currently in scope.</div><div><br></div><div>I&#39;m currently playing with the isInstance function (I&#39;m running GHC 7.4.1) and can get a list of instances, and check if a given type is part of a typeclass or not. But I don&#39;t know how to create the expression corresponding to &quot;instantiated function&quot;, as above.</div>
<div><br></div><div>Thanks!</div><div>-- <br>Ismael<br><br>
</div></div>