projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add separate functions for querying DynFlag and ExtensionFlag options
[ghc-hetmet.git]
/
compiler
/
deSugar
/
Match.lhs
diff --git
a/compiler/deSugar/Match.lhs
b/compiler/deSugar/Match.lhs
index
d64a649
..
2c9aa0b
100644
(file)
--- a/
compiler/deSugar/Match.lhs
+++ b/
compiler/deSugar/Match.lhs
@@
-42,9
+42,10
@@
import SrcLoc
import Maybes
import Util
import Name
import Maybes
import Util
import Name
-import FiniteMap
import Outputable
import FastString
import Outputable
import FastString
+
+import qualified Data.Map as Map
\end{code}
This function is a wrapper of @match@, it must be called from all the parts where
\end{code}
This function is a wrapper of @match@, it must be called from all the parts where
@@
-292,7
+293,7
@@
match vars@(v:_) ty eqns
; let grouped = groupEquations tidy_eqns
-- print the view patterns that are commoned up to help debug
; let grouped = groupEquations tidy_eqns
-- print the view patterns that are commoned up to help debug
- ; ifOptM Opt_D_dump_view_pattern_commoning (debug grouped)
+ ; ifDOptM Opt_D_dump_view_pattern_commoning (debug grouped)
; match_results <- mapM match_group grouped
; return (adjustMatchResult (foldr1 (.) aux_binds) $
; match_results <- mapM match_group grouped
; return (adjustMatchResult (foldr1 (.) aux_binds) $
@@
-801,14
+802,14
@@
subGroup :: Ord a => [(a, EquationInfo)] -> [[EquationInfo]]
-- Each sub-list in the result has the same PatGroup
-- See Note [Take care with pattern order]
subGroup group
-- Each sub-list in the result has the same PatGroup
-- See Note [Take care with pattern order]
subGroup group
- = map reverse $ eltsFM $ foldl accumulate emptyFM group
+ = map reverse $ Map.elems $ foldl accumulate Map.empty group
where
accumulate pg_map (pg, eqn)
where
accumulate pg_map (pg, eqn)
- = case lookupFM pg_map pg of
- Just eqns -> addToFM pg_map pg (eqn:eqns)
- Nothing -> addToFM pg_map pg [eqn]
+ = case Map.lookup pg pg_map of
+ Just eqns -> Map.insert pg (eqn:eqns) pg_map
+ Nothing -> Map.insert pg [eqn] pg_map
- -- pg_map :: FiniteMap a [EquationInfo]
+ -- pg_map :: Map a [EquationInfo]
-- Equations seen so far in reverse order of appearance
\end{code}
-- Equations seen so far in reverse order of appearance
\end{code}