git.iko.soy/rowtype-yoga/purescript-native
on 041e4ea help sign in
28 lines 693 B history raw
1-----------------------------------------------------------------------------
2--
3-- Module : Data.Generics.Extras
4-- Copyright : (c) Phil Freeman 2013
5-- License : MIT
6--
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
9-- Portability :
10--
11-- |
12-- Additional SYB combinators
13--
14-----------------------------------------------------------------------------
16{-# LANGUAGE Rank2Types #-}
18module Data.Generics.Extras where
20import Data.Data
22-- |
23-- Apply a top-down monadic transformation everywhere
24--
25everywhereM' :: (Monad m, Data d) => (forall d1. (Data d1) => d1 -> m d1) -> d -> m d
26everywhereM' f x = do
27 y <- f x
28 gmapM (everywhereM' f) y