<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">This is a wonderfully clever idea, but it has the unfortunate consequence of making the new default lift (written in terms of liftTyped) unusable even if you provide a custom liftTyped. I’ve had to write my own lift on occasion (eg for types that contain Text fields), so this is something we should consider. That being said, the consequence of the TypeError fix is that custom instances will need an extra one-line definition of lift, which is not that severe. <div><br></div><div>This whole issue does make me wonder though, why does a violation of the MINIMAL pragma produce a warning rather than an error? It seems like the standard use case is to describe how one can break a chain of mutually-recursive default definitions. Failure to do so will result in a non-terminating program, which really ought to be an error. <br><div><br></div><div><div dir="ltr" id="AppleMailSignature">Sent from my iPhone</div><div dir="ltr"><br>On Nov 7, 2018, at 10:40, Richard Eisenberg <<a href="mailto:rae@cs.brynmawr.edu">rae@cs.brynmawr.edu</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii">If we really want to encourage users to use `DeriveLift`, we could do something like<div class=""><br class=""></div><div class="">class Lift t where</div><div class="">  ...</div><div class="">  default lift :: TypeError "Use DeriveLift" => ...</div><div class=""><br class=""></div><div class="">Then, anyone relying on the old behavior would get a beautiful error message telling them exactly how to migrate.</div><div class=""><br class=""></div><div class="">Richard<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 5, 2018, at 6:31 PM, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" class="">iavor.diatchki@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">I'd be surprised if there is a lot of code affected by that.   Either way,  I guess this wouldn't be an issue, if we just changed the proposal to make the default instance for `typedLift` looks like the old default for `lift` (i.e., use the `Data` constraint).</div><div class=""><br class=""></div><div class="">The proposed design does have two benefits though:</div><div class="">   * The new design requires fewer GHC extensions (no need for `DefaultSignatures`)</div><div class="">   * It encourages programmers to use `DeriveLift`, which is shorter, safer, and more direct.</div><div class=""><br class=""></div><div class="">-Iavor</div><div class=""><br class=""></div><div class=""> </div></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Nov 5, 2018 at 10:50 AM Richard Eisenberg <<a href="mailto:rae@cs.brynmawr.edu" class="">rae@cs.brynmawr.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Will this break existing code? The proposal suggests that liftTyped will have a suitable default implementation.<br class="">
<br class="">
Actually, this will break code, but not in the way one might think (with an undefined liftTyped). Instead, the proposal removes the default implementation of lift to use liftTyped. This means that any code relying on the default implementation of lift will now have an instance with mutually recursive, non-terminating methods. And this will all be silent. And, it's something that might be discovered only in clients of a library, rather than in the library itself. So I think that's pretty problematic. Even with our recommendation to derive Lift instances, this change in behavior is so terrible that it makes me lean against the proposal. Is there a design / migration path that avoids this problem?<br class="">
<br class="">
(Yes, yes, I know that I could voiced this opinion earlier, but it didn't occur to me until just now.)<br class="">
<br class="">
Richard<br class="">
<br class="">
> On Nov 5, 2018, at 1:37 PM, Ben Gamari <<a href="mailto:ben@well-typed.com" target="_blank" class="">ben@well-typed.com</a>> wrote:<br class="">
> <br class="">
> Hi everyone,<br class="">
> <br class="">
> I have been asked to Shepard #175, which proposes to add a `liftTyped`<br class="">
> method to the `Lift` typeclass used to lift Haskell values into Template<br class="">
> Haskell splices. Currently the `Lift` typeclass provides no guarantee of<br class="">
> type-safety, even when used in a Typed Template Haskell context.<br class="">
> <br class="">
> The proposal resolves this limitation by adding a typed lifting<br class="">
> operation to the `Lift` class:<br class="">
> <br class="">
>    class Lift t where<br class="">
>      lift :: t -> Q Exp<br class="">
>      liftTyped :: t -> Q (TExp t)<br class="">
> <br class="">
> While this addition will break manually-written `Lift` instances, we<br class="">
> recommended that users derive such instances for quite a while now, so<br class="">
> it is not expected that the breakage will be wide-spread. In light of<br class="">
> this, I recommend that we accept this proposal.<br class="">
> <br class="">
> Given that we will likely want to get this in to 8.8, I suggest that we<br class="">
> limit the discussion to a week unless there is dissent.<br class="">
> <br class="">
> Cheers,<br class="">
> <br class="">
> - Ben<br class="">
> _______________________________________________<br class="">
> ghc-steering-committee mailing list<br class="">
> <a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@haskell.org</a><br class="">
> <a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br class="">
<br class="">
_______________________________________________<br class="">
ghc-steering-committee mailing list<br class="">
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@haskell.org</a><br class="">
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>ghc-steering-committee mailing list</span><br><span><a href="mailto:ghc-steering-committee@haskell.org">ghc-steering-committee@haskell.org</a></span><br><span><a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a></span><br></div></blockquote></div></div></body></html>