summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2013-02-11 23:07:25 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2013-02-11 23:07:25 -0500
commit7b098b6009727a012cb1f3ff0ca51698d302cae1 (patch)
treeb31f47c210d042f71bd2fc74c7860bb445173b87 /compiler/coreSyn
parent04d7220af65431247a1281fea122e64d5d218d1a (diff)
downloadhaskell-7b098b6009727a012cb1f3ff0ca51698d302cae1.tar.gz
Fix Trac #7681.
Removed checks for empty lists for case expressions and lambda-case. If -XEmptyCase is not enabled, compilation still fails (appropriately) in the renamer. Had to remove dead code from TrieMap to pass the validator.
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/TrieMap.lhs38
1 files changed, 1 insertions, 37 deletions
diff --git a/compiler/coreSyn/TrieMap.lhs b/compiler/coreSyn/TrieMap.lhs
index 148464b852..c013b5da7a 100644
--- a/compiler/coreSyn/TrieMap.lhs
+++ b/compiler/coreSyn/TrieMap.lhs
@@ -14,7 +14,7 @@
{-# LANGUAGE TypeFamilies #-}
module TrieMap(
CoreMap, emptyCoreMap, extendCoreMap, lookupCoreMap, foldCoreMap,
- TypeMap, foldTypeMap, lookupTypeMap_mod,
+ TypeMap, foldTypeMap, -- lookupTypeMap_mod,
CoercionMap,
MaybeMap,
ListMap,
@@ -32,8 +32,6 @@ import UniqFM
import Unique( Unique )
import FastString(FastString)
-import Unify ( niFixTvSubst )
-
import qualified Data.Map as Map
import qualified Data.IntMap as IntMap
import VarEnv
@@ -632,40 +630,6 @@ lkT env ty m
go (ForAllTy tv ty) = tm_forall >.> lkT (extendCME env tv) ty >=> lkBndr env tv
-lkT_mod :: CmEnv
- -> TyVarEnv Type -- TvSubstEnv
- -> Type
- -> TypeMap b -> Maybe b
-lkT_mod env s ty m
- | EmptyTM <- m = Nothing
- | Just ty' <- coreView ty
- = lkT_mod env s ty' m
- | [] <- candidates
- = go env s ty m
- | otherwise
- = Just $ snd (head candidates) -- Yikes!
- where
- -- Hopefully intersects is much smaller than traversing the whole vm_fvar
- intersects = eltsUFM $
- intersectUFM_C (,) s (vm_fvar $ tm_var m)
- candidates = [ (u,ct) | (u,ct) <- intersects
- , Type.substTy (niFixTvSubst s) u `eqType` ty ]
-
- go env _s (TyVarTy v) = tm_var >.> lkVar env v
- go env s (AppTy t1 t2) = tm_app >.> lkT_mod env s t1 >=> lkT_mod env s t2
- go env s (FunTy t1 t2) = tm_fun >.> lkT_mod env s t1 >=> lkT_mod env s t2
- go env s (TyConApp tc tys) = tm_tc_app >.> lkNamed tc >=> lkList (lkT_mod env s) tys
- go _env _s (LitTy l) = tm_tylit >.> lkTyLit l
- go _env _s (ForAllTy _tv _ty) = const Nothing
-
- {- DV TODO: Add proper lookup for ForAll -}
-
-lookupTypeMap_mod :: TyVarEnv a -- A substitution to be applied to the /keys/ of type map
- -> (a -> Type)
- -> Type
- -> TypeMap b -> Maybe b
-lookupTypeMap_mod s f = lkT_mod emptyCME (mapVarEnv f s)
-
-----------------
xtT :: CmEnv -> Type -> XT a -> TypeMap a -> TypeMap a
xtT env ty f m