Actually, looking at the docs for UniplateStr[1], isn't there an error in the following example statement in the Queries section?<div><span class="Apple-style-span" style="font-family: -webkit-sans-serif; font-size: 16px; "><pre style="">
<span class="Apple-style-span" style="font-size: small;">vals x = [Val i | i <- universe x]</span></pre></span><div>Shouldn't that be:</div><div><br></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;">vals x = [i | Val i <- universe x]</span></div>
<div><br></div><div>?</div><div><br></div><div>/jve</div><div><br></div><div>1. <a href="http://hackage.haskell.org/packages/archive/uniplate/1.2.0.3/doc/html/Data-Generics-UniplateStr.html">http://hackage.haskell.org/packages/archive/uniplate/1.2.0.3/doc/html/Data-Generics-UniplateStr.html</a><br>
<br><br><div class="gmail_quote">On Thu, Mar 26, 2009 at 1:47 PM, minh thu <span dir="ltr"><<a href="mailto:noteed@gmail.com">noteed@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2009/3/26 Vasyl Pasternak <<a href="mailto:vasyl.pasternak@gmail.com">vasyl.pasternak@gmail.com</a>>:<br>
<div class="im">> Hi,<br>
><br>
> I want to parse haskell file to find all calls to function 'foo' and<br>
> gathers a create a list of all<br>
> argumets, which passed to it. E.g. from the following code:<br>
><br>
> f1 = foo 5<br>
> f2 = foo 8<br>
> f3 = foo 9<br>
><br>
> I want to extract a list [5, 8, 9] (suppouse function takes only one argument)<br>
><br>
> The most obvious way is to use Language.Haskell for this task. The<br>
> parser works pretty good,<br>
> but its output data type is terrible. As I understand, I need to<br>
> extract all objects that looks like<br>
> HsApp (HsVar (UnQual (HsIdent "foo"))) ....<br>
><br>
> The question is, is there a method to do it quickly or I have to<br>
> process each object of different type<br>
> separately ?<br>
<br>
</div>Have a look at this:<br>
<a href="http://neilmitchell.blogspot.com/2009/03/concise-generic-queries.html" target="_blank">http://neilmitchell.blogspot.com/2009/03/concise-generic-queries.html</a><br>
<br>
Cheers,<br>
<font color="#888888">Thu<br>
</font><div><div></div><div class="h5">_______________________________________________<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></div>