Add everywhereM' to Data.Generics.Schemes

José Pedro Magalhães jpm at
Mon Apr 12 15:35:25 EDT 2010

Hi Maciej,

Data.Generics.Schemes is now on the syb package, and I'm its maintainer. But
I'm not so sure it is wise to start adding more traversal schemes of this
form, since there might be many of them: if we include everywhereM', we
certainly have to include the bottom-up everywhereM too. Then there are the
possible Applicative variants, etc...

In general, since these traversal functions are small and everywhere and
everywhere' already show the pattern of how to write them, maybe it's best
that they are defined by the user, unless there is some general consensus
that they would be widely useful.


On Mon, Apr 12, 2010 at 20:56, Maciej Podgurski <
maciej.podgurski at> wrote:

> Hello,
> as an analogue to everywhere', I suggest adding everywhereM' to
> Data.Generics.Schemes. The implementation would be
>   everywhereM' :: Monad m => GenericM m -> GenericM m
>   everywhereM' f x = do { x' <- f x;
>                           gmapM (everywhereM' f) x' }
> Best wishes,
> Maciej
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Libraries mailing list