Fix #569
commitdb4fd450e7750a0e585a0cdae15ffd904cac41ec
authorPhil Freeman <paf31@cantab.net>
dateSun 24 Aug 2014, 17:15 (12 years ago)
parent2e0559b
examples/passing/OperatorAssociativity.pursnew file+15
@@ -0,0 +1,15 @@
1+module Main where
2+
3+import Control.Monad.Eff
4+
5+bug :: Number -> Number -> Number
6+bug a b = 0 - (a - b)
7+
8+foreign import explode
9+ "function explode() {\
10+ \ throw new Error('Assertion failed!');\
11+ \}":: forall eff a. Eff eff a
12+
13+main = case bug 0 2 of
14+ 2 -> Debug.Trace.trace "Done!"
15+ _ -> explode
src/Language/PureScript/Pretty/JS.hs+1−1
@@ -190,7 +190,7 @@ unary op str = Wrap match (++)
190190 match' _ = Nothing
191191
192192binary :: BinaryOperator -> String -> Operator PrinterState JS String
193−binary op str = AssocR match (\v1 v2 -> v1 ++ " " ++ str ++ " " ++ v2)
193+binary op str = AssocL match (\v1 v2 -> v1 ++ " " ++ str ++ " " ++ v2)
194194 where
195195 match :: Pattern PrinterState JS (JS, JS)
196196 match = mkPattern match'