<div dir="ltr"><div>I'm also generating code at the same time, and might have gotten confused by that interaction :)<br><br></div>In the meantime I guess I'll implement HM. The world will be a much better place when TTG is finished and we have ghc-as-an-easy-to-use-library :)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 19, 2020 at 2:51 AM Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Good to see you around, Sandy!<br><div><br><blockquote type="cite"><div>On Mar 18, 2020, at 6:54 PM, Sandy Maguire <<a href="mailto:sandy@sandymaguire.me" target="_blank">sandy@sandymaguire.me</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">I mean if `insert :: a -> Container a -> Container a`, and I call it with `[e| insert 5 True |]`, the quote will fail.</span></div></blockquote></div><br><div>I don't observe this. Specifically, when I compile</div><div><br></div><div><div></div></div><blockquote type="cite"><div><div>{-# LANGUAGE TemplateHaskellQuotes #-}</div><div><br></div><div>module Bug where</div><div><br></div><div>import Prelude ( Bool(..), undefined )</div><div><br></div><div>data Container a</div><div><br></div><div>insert :: a -> Container a -> Container a</div><div>insert = undefined</div><div><br></div><div>quote = [e| insert 5 True |]</div></div></blockquote><div><br></div><div>GHC happily succeeds.</div><div><br></div><div>I think what you want, though, is reasonable: you want the ability to send an expression through GHC's type-checker. I think we'd need to extend TH to be able to support this, and it will be hard to come up with a good design, I think. (Specifically, I'm worried about interactions with top-level defined entities, whose types might not really be known by the time of splice processing.) This might all be worthwhile -- singletons would be able to be improved with this, for example -- but it's not cheap, sadly.</div><div><br></div><div>Richard</div></div></blockquote></div>