Hi,<div><br class="webkit-block-placeholder"></div><div>I'm wondering if I can (ab)use from TH in order to generalize a context-dependant function into a generic function without that context, as long as I now that the arguments I'm applying the function to belong to the class.
</div><div><br class="webkit-block-placeholder"></div><div>I guess this would work similarly to an automatic instance generation example.</div><div><br class="webkit-block-placeholder"></div><div>My example would be:</div>
<div><br class="webkit-block-placeholder"></div><div><div>module Main where</div><div> </div><div><div>myprint :: a -> String</div><div>myprint = show</div><div><br class="webkit-block-placeholder"></div><div>main = do
</div><div> putStr $ myprint 1</div><div> putStr $ myprint '2'</div></div><div><br class="webkit-block-placeholder"></div><div>My ideia would be to stage the computation of <i>myprint</i> until it is called, where the
<i>Show</i> instance can be satisfied.</div><div><br class="webkit-block-placeholder"></div><div>hugo</div></div>