aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs2
-rw-r--r--src/Map.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index a83376f3..fcac054b 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -828,7 +828,7 @@ buildOrigEnv :: Module -> Bool -> ModuleMap -> [HsImportDecl]
-> ErrMsgM (Map HsQName HsQName)
buildOrigEnv this_mdl verbose mod_map imp_decls
= do maps <- mapM build imp_decls
- return (Map.unions maps)
+ return (Map.unions (reverse maps))
where
build imp_decl@(HsImportDecl _ mdl qual maybe_as _)
= case Map.lookup mdl mod_map of
diff --git a/src/Map.hs b/src/Map.hs
index 64d28df0..16cebdee 100644
--- a/src/Map.hs
+++ b/src/Map.hs
@@ -47,7 +47,7 @@ unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
unionWith c l r = plusFM_C c r l
unions :: Ord k => [Map k a] -> Map k a
-unions = foldr plusFM emptyFM
+unions = foldl (flip plusFM) emptyFM
elems :: Map k a -> [a]
elems = eltsFM