diff --git a/transformations/Unnest.hs b/transformations/Unnest.hs index 98f937d..7ead897 100644 --- a/transformations/Unnest.hs +++ b/transformations/Unnest.hs @@ -82,11 +82,12 @@ freeNamesIn = doGeneric -- | Replace names. replaceNames :: Data t => [(A.Name, A.Name)] -> t -> t -replaceNames map p = everywhere (mkT doName - `extT` (id :: String -> String) - `extT` (id :: Meta -> Meta) - ) p +replaceNames map = doGeneric `extT` doName where + doGeneric :: Data t => t -> t + doGeneric = (gmapT (replaceNames map)) + `extT` (id :: String -> String) + `extT` (id :: Meta -> Meta) smap = [(A.nameName f, t) | (f, t) <- map] doName :: A.Name -> A.Name