[project @ 2000-07-03 19:48:07 by panne]
authorpanne <unknown>
Mon, 3 Jul 2000 19:48:07 +0000 (19:48 +0000)
committerpanne <unknown>
Mon, 3 Jul 2000 19:48:07 +0000 (19:48 +0000)
Putting parentheses around expressions involving a mixture of
multiplicative and additive operators might sometimes be a cunning
idea...   :-}   Otherwise
   (591125662431::Int) `div` (517::Int)
is correctly converted into
   (567659506 + (275 * 2147483647)) `div`  517
but
    591125662431       `div` (517::Int)
turns into the messed up
    567659506 + ((275 * 2147483647) `div`  517)

ghc/compiler/rename/RnExpr.lhs

index 5102f54..e1125a9 100644 (file)
@@ -487,7 +487,7 @@ horner b i | abs q <= 1 = if r == 0 || r == i then mkInt i else mkInt r `plus` m
          mkInt i  = HsLit (HsInt i)
          plus     = mkOp "+"
          times    = mkOp "*"
-         mkOp op = \x y -> OpApp x (HsVar (mkSrcUnqual varName (_PK_ op))) (panic "fixity") y
+         mkOp op  = \x y -> HsPar (OpApp x (HsVar (mkSrcUnqual varName (_PK_ op))) (panic "fixity") y)
 \end{code}
 
 %************************************************************************