<div dir="auto">+1 to Michael's suggestion; that's basically the same thing I would have suggested, modulo bikeshedding.</div><div class="gmail_extra"><br><div class="gmail_quote">On Jan 13, 2018 15:03, "Michael Sloan" <<a href="mailto:mgsloan@gmail.com">mgsloan@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hmm, I'm not sure about changing the Lift class, there are good<br>
reasons to leave it the same and good reasons to change as well.<br>
There is a lot of precedent for providing safe functions which use<br>
unsafe functions (e.g. unsafeDupablePerformIO in bytestring / text).<br>
Also, not much of the TH API uses TExp, just typed splices. On the<br>
other hand, it does make the method's type stronger and directly<br>
suggest more properties. It may encourage people to use typed splices<br>
to define manual instances, which I think is good.<br>
<br>
I propose a somewhat less breaking change, defining the following:<br>
<br>
class Lift t where<br>
typedLift :: t -> Q (TExp t)<br>
<br>
lift :: Lift t => t -> Q t<br>
lift = fmap unType . typedLift<br>
<br>
The advantage of this is that a lot more code depends on usage of<br>
'lift' than defining instances of 'Lift'. A lot of the code that<br>
defines instances of 'Lift' does it via the 'th-lift' package. I<br>
believe that only a handful of packages would need to be updated as a<br>
result of this change, vs the dozens that would need to be updated by<br>
changing the type of 'lift'.<br>
<br>
Even after this change, I think that since 'TExp' is only useful with<br>
typed splices, the 'lift' form would still find much more usage as the<br>
more convenient function.<br>
<font color="#888888"><br>
-Michael<br>
</font><div class="elided-text">______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
</div></blockquote></div><br></div>