From 147d799563e4365006a79b61f0445ad4ccb7c195 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 23 Feb 2008 18:34:02 +0000 Subject: [PATCH] Changed the replaceNames function so that it doesn't use everywhere --- transformations/Unnest.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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