[Haskell-cafe] Scrap your boilerplate traversals
Neil Brown
nccb2 at kent.ac.uk
Wed Nov 25 15:04:49 EST 2009
Hi,
You want gmapT (or gmapM for the monadic version). If you look at the
source to the everywhere function, you'll see that everywhere is defined
in terms of gmapT:
everywhere f = f . gmapT (everywhere f)
Thanks,
Neil.
rodrigo.bonifacio wrote:
>
> Hi all,
>
> Is there a non-recursive traversal defined in Data.Generics' modules?
> I mean, the everywhere traversal first applies a function "f" to the
> subterms, and then applies "f" to the result. I am wondering if do
> exists a traversal that applies f only to the subterms.
>
> Thanks in advance,
>
> Rodrigo.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
More information about the Haskell-Cafe
mailing list