X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnExpr.lhs;h=62702334796afedd7f63c85554c538338fdda019;hb=0ef29fb878dd6517d2716afb056bcf2536c2562e;hp=40e3f9ed1bda4779282207acb8afe698b1c8e3dd;hpb=fb2442c0498868330476f5fdde46339eab68e72d;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnExpr.lhs b/ghc/compiler/rename/RnExpr.lhs index 40e3f9e..6270233 100644 --- a/ghc/compiler/rename/RnExpr.lhs +++ b/ghc/compiler/rename/RnExpr.lhs @@ -121,10 +121,10 @@ rnPat (ConOpPatIn pat1 con _ pat2) getModeRn `thenRn` \ mode -> -- See comments with rnExpr (OpApp ...) - (case mode of - InterfaceMode -> returnRn (ConOpPatIn pat1' con' defaultFixity pat2') - SourceMode -> lookupFixityRn con' `thenRn` \ fixity -> - mkConOpPatRn pat1' con' fixity pat2' + (if isInterfaceMode mode + then returnRn (ConOpPatIn pat1' con' defaultFixity pat2') + else lookupFixityRn con' `thenRn` \ fixity -> + mkConOpPatRn pat1' con' fixity pat2' ) `thenRn` \ pat' -> returnRn (pat', fvs1 `plusFV` fvs2 `addOneFV` con') @@ -313,10 +313,10 @@ rnExpr (OpApp e1 op _ e2) -- that the deriving code generator got the association correct -- Don't even look up the fixity when in interface mode getModeRn `thenRn` \ mode -> - (case mode of - SourceMode -> lookupFixityRn op_name `thenRn` \ fixity -> - mkOpAppRn e1' op' fixity e2' - InterfaceMode -> returnRn (OpApp e1' op' defaultFixity e2') + (if isInterfaceMode mode + then returnRn (OpApp e1' op' defaultFixity e2') + else lookupFixityRn op_name `thenRn` \ fixity -> + mkOpAppRn e1' op' fixity e2' ) `thenRn` \ final_e -> returnRn (final_e, @@ -734,10 +734,10 @@ checkPrecMatch True op (Match _ (p1:p2:_) _ _) -- True indicates an infix lhs = getModeRn `thenRn` \ mode -> -- See comments with rnExpr (OpApp ...) - case mode of - InterfaceMode -> returnRn () - SourceMode -> checkPrec op p1 False `thenRn_` - checkPrec op p2 True + if isInterfaceMode mode + then returnRn () + else checkPrec op p1 False `thenRn_` + checkPrec op p2 True checkPrecMatch True op _ = panic "checkPrecMatch"