X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplCore%2FSimplUtils.lhs;h=57c7274027e059697389d3c00f91d2139dc7c4fd;hb=711e4d7a4d65472a3a1fb35bcad8e1c9a109c728;hp=817ae8fc1bdbdc9032f6814e68d0378bc899f1b1;hpb=e70309951a888dfa8629b2e07dbc30795550f868;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/SimplUtils.lhs b/ghc/compiler/simplCore/SimplUtils.lhs index 817ae8f..57c7274 100644 --- a/ghc/compiler/simplCore/SimplUtils.lhs +++ b/ghc/compiler/simplCore/SimplUtils.lhs @@ -41,7 +41,7 @@ import Type ( Type, seqType, splitRepFunTys, isStrictType, ) import TcType ( isDictTy ) import OccName ( UserFS ) -import TyCon ( tyConDataConsIfAvailable, isAlgTyCon, isNewTyCon ) +import TyCon ( tyConDataCons_maybe, isAlgTyCon, isNewTyCon ) import DataCon ( dataConRepArity, dataConSig, dataConArgTys ) import Var ( mkSysTyVar, tyVarKind ) import Util ( lengthExceeds, mapAccumL ) @@ -405,10 +405,10 @@ canUpdateInPlace ty | otherwise = case splitTyConApp_maybe ty of Nothing -> False - Just (tycon, _) -> case tyConDataConsIfAvailable tycon of - [dc] -> arity == 1 || arity == 2 - where - arity = dataConRepArity dc + Just (tycon, _) -> case tyConDataCons_maybe tycon of + Just [dc] -> arity == 1 || arity == 2 + where + arity = dataConRepArity dc other -> False \end{code} @@ -891,8 +891,8 @@ mkAlts scrut handled_cons case_bndr alts -- case x of { DEFAULT -> e } -- and we don't want to fill in a default for them! - [missing_con] <- [con | con <- tyConDataConsIfAvailable tycon, - not (con `elem` handled_data_cons)] + Just all_cons <- tyConDataCons_maybe tycon, + [missing_con] <- [con | con <- all_cons, not (con `elem` handled_data_cons)] -- There is just one missing constructor! = tick (FillInCaseDefault case_bndr) `thenSmpl_`