<div dir="ltr">For expanding/inlining type synonyms, there is also th-expand-syns (<a href="http://hackage.haskell.org/package/th-expand-syns">http://hackage.haskell.org/package/th-expand-syns</a>).<div><br></div><div style>

/Anders</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 2, 2013 at 3:25 AM, Richard Eisenberg <span dir="ltr">&lt;<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No, but I agree that this behavior is useful and in the spirit of th-desugar. I can add this to the next version, which should come out in a few days (tomorrow?), because I&#39;ve noticed a bug with the scoping of as-patterns in let statements.<br>


<br>
Thanks for the suggestion!<br>
<span class="HOEnZb"><font color="#888888">Richard<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Aug 31, 2013, at 12:06 PM, Sjoerd Visscher wrote:<br>
<br>
&gt; Great package!<br>
&gt;<br>
&gt; One question: Do you remove/inline type synonyms? I ask because I just ran into this with some TH code. I&#39;m looking for types that end with -&gt; a, but that fails when type synonyms are involved.<br>
&gt;<br>
&gt; Sjoerd<br>
&gt;<br>
&gt; On Aug 30, 2013, at 2:08 AM, Richard Eisenberg &lt;<a href="mailto:eir@cis.upenn.edu">eir@cis.upenn.edu</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; I&#39;ve just uploaded my new th-desugar package, which enables easier processing of Template Haskell source syntax by desugaring it into a much simpler core language. The meaning of the code after desugaring is identical to before desugaring, but the syntax is much simpler. To wit, th-desugar simplifies out all of the following constructs:<br>


&gt;&gt;<br>
&gt;&gt; - guarded expressions in both functions and case statements<br>
&gt;&gt; - &quot;where&quot; declarations<br>
&gt;&gt; - do syntax<br>
&gt;&gt; - list/monad comprehensions<br>
&gt;&gt; - record creation / updates<br>
&gt;&gt; - as patterns<br>
&gt;&gt; - non-trivial patterns in a lambda expression<br>
&gt;&gt; - lambda-case<br>
&gt;&gt; - multi-way if<br>
&gt;&gt; - several more<br>
&gt;&gt;<br>
&gt;&gt; If you are writing a library that manipulates Template Haskell syntax, you may wish to consider if th-desugar will make your job easier by forcing you to consider fewer cases. The one source Haskell construct supported by Template Haskell but not supported by th-desguar is view patterns, mostly because these interact quite non-trivially with pattern binders. It&#39;s possible this hole will be closed in a future version.<br>


&gt;&gt;<br>
&gt;&gt; Enjoy!<br>
&gt;&gt; Richard<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Haskell-Cafe mailing list<br>
&gt;&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>