on master help sign in
Fix generation of infix ops
commitbdd8213e6de020772ba99b8078d9d8e0f01ade96 authorEvan Czaplicki <info@elm-lang.org> dateTue 3 Sep 2013, 01:30 (13 years ago) parent8a255de
1 file changed+3−3
compiler/Generate/JavaScript.hs+3−3
compiler/Generate/JavaScript.hs+3−3
@@ -378,10 +378,10 @@ binop span op e1 e2 =
378378
379379 opDict = Map.fromList (infixOps ++ specialOps)
380380
381− specialOp str func = ("Basics." ++ str, func)
381+ specialOp str func = [ (str, func), ("Basics." ++ str, func) ]
382382 infixOp str op = specialOp str (InfixExpr () op)
383383
384− infixOps =
384+ infixOps = concat
385385 [ infixOp "+" OpAdd
386386 , infixOp "-" OpSub
387387 , infixOp "*" OpMul
@@ -390,7 +390,7 @@ binop span op e1 e2 =
390390 , infixOp "||" OpLOr
391391 ]
392392
393− specialOps =
393+ specialOps = concat
394394 [ specialOp "^" $ \a b -> obj "Math.pow" `call` [a,b]
395395 , specialOp "|>" $ flip (<|)
396396 , specialOp "==" $ \a b -> obj "_N.eq" `call` [a,b]