[Haskell-cafe] Language.Haskell.Parser question

John Van Enk vanenkj at gmail.com
Thu Mar 26 15:35:48 EDT 2009


Actually, looking at the docs for UniplateStr[1], isn't there an error in
the following example statement in the Queries section?

vals x = [Val i | i <- universe x]

Shouldn't that be:

vals x = [i | Val i <- universe x]

?

/jve

1.
http://hackage.haskell.org/packages/archive/uniplate/1.2.0.3/doc/html/Data-Generics-UniplateStr.html


On Thu, Mar 26, 2009 at 1:47 PM, minh thu <noteed at gmail.com> wrote:

> 2009/3/26 Vasyl Pasternak <vasyl.pasternak at gmail.com>:
> > Hi,
> >
> > I want to parse haskell file to find all calls to function 'foo' and
> > gathers a create a list of all
> > argumets, which passed to it. E.g. from the following code:
> >
> > f1 = foo 5
> > f2 = foo 8
> > f3 = foo 9
> >
> >  I want to extract a list [5, 8, 9] (suppouse function takes only one
> argument)
> >
> > The most obvious way is to use Language.Haskell for this task. The
> > parser works pretty good,
> > but its output data type is terrible. As I understand, I need to
> > extract all objects that looks like
> > HsApp (HsVar (UnQual (HsIdent "foo"))) ....
> >
> > The question is, is there a method to do it quickly or I have to
> > process each object of different type
> > separately ?
>
> Have a look at this:
> http://neilmitchell.blogspot.com/2009/03/concise-generic-queries.html
>
> Cheers,
> Thu
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090326/1f1f4a81/attachment.htm


More information about the Haskell-Cafe mailing list