<p dir="ltr">+1<br>
</p>
<br><div class="gmail_quote">Dne pá 17. 4. 2015 13:21 uživatel Edward Z. Yang <<a href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>> napsal:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I propose adding the following function to <a href="http://Language.Haskell.TH" target="_blank">Language.Haskell.TH</a>:<br>
<br>
    -- | 'liftData' is a variant of 'lift' in the 'Lift' type class which<br>
    -- works for any type with a 'Data' instance.<br>
    liftData :: Data a => a -> Q Exp<br>
    liftData = dataToExpQ (const Nothing)<br>
<br>
I don't really know which submodule this should come from;<br>
since it uses 'dataToExpQ', you might put it in Language.Haskell.TH.Quote<br>
but arguably 'dataToExpQ' doesn't belong in this module either,<br>
and it only lives there because it is a useful function for defining<br>
quasiquoters and it was described in the quasiquoting paper.<br>
<br>
I might propose getting rid of the 'Lift' class entirely, but you<br>
might prefer that class since it doesn't go through SYB (and have<br>
the attendant slowdown).<br>
<br>
This mode of use of 'dataToExpQ' deserves more attention.<br>
<br>
Discussion period: 1 month<br>
<br>
Cheers,<br>
Edward<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>