X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FMatch.lhs;h=2c9aa0bfd876b922cd703623f471f7e7151398a3;hp=d64a649b3717215fe2ee94381a5f33ea4bec0e5a;hb=a6f2d598e1e7760d334d1b5ea0b7745e66835e11;hpb=7fc01c4671980ea3c66d549c0ece4d82fd3f5ade diff --git a/compiler/deSugar/Match.lhs b/compiler/deSugar/Match.lhs index d64a649..2c9aa0b 100644 --- a/compiler/deSugar/Match.lhs +++ b/compiler/deSugar/Match.lhs @@ -42,9 +42,10 @@ import SrcLoc import Maybes import Util import Name -import FiniteMap 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 @@ -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 - ; 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) $ @@ -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 - = map reverse $ eltsFM $ foldl accumulate emptyFM group + = map reverse $ Map.elems $ foldl accumulate Map.empty group 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}