Changed the replaceNames function so that it doesn't use everywhere

This commit is contained in:
Neil Brown 2008-02-23 18:34:02 +00:00
parent ae49d236d6
commit 147d799563

View File

@ -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