on master help sign in
Take out the F# inspired composition operators. I think this needs to wait until type-classes / monads / arrows are more figured out.
ac67dbdevancz
compiler/Gen/CompileToJS.hs−2
@@ -328,8 +328,6 @@ binop (o:p) e1 e2
328 "<|" -> e1 ++ parens e2
328 "<|" -> e1 ++ parens e2
329 "|>" -> e2 ++ parens e1
329 "|>" -> e2 ++ parens e1
330 "." -> jsFunc "x" . ret $ e1 ++ parens (e2 ++ parens "x")
330 "." -> jsFunc "x" . ret $ e1 ++ parens (e2 ++ parens "x")
331− "<<" -> jsFunc "x" . ret $ e1 ++ parens (e2 ++ parens "x")
332− ">>" -> jsFunc "x" . ret $ e2 ++ parens (e1 ++ parens "x")
333 "^" -> "Math.pow(" ++ e1 ++ "," ++ e2 ++ ")"
331 "^" -> "Math.pow(" ++ e1 ++ "," ++ e2 ++ ")"
334 "==" -> "_N.eq(" ++ e1 ++ "," ++ e2 ++ ")"
332 "==" -> "_N.eq(" ++ e1 ++ "," ++ e2 ++ ")"
335 "/=" -> "!_N.eq(" ++ e1 ++ "," ++ e2 ++ ")"
333 "/=" -> "!_N.eq(" ++ e1 ++ "," ++ e2 ++ ")"
compiler/Parse/Binops.hs+1−1
@@ -17,7 +17,7 @@ data Assoc = L | N | R deriving (Eq,Show)
17type OpTable = [(Int, Assoc, String)]
17type OpTable = [(Int, Assoc, String)]
18
18
19table :: OpTable
19table :: OpTable
20−table = [ (9, R, "."), (9, R, "<<"), (9, L, ">>")
20+table = [ (9, R, ".")
21 , (8, R, "^")
21 , (8, R, "^")
22 , (7, L, "*"), (7, L, "/"), (7, L, "mod"), (7, L, "div"), (7, L, "rem")
22 , (7, L, "*"), (7, L, "/"), (7, L, "mod"), (7, L, "div"), (7, L, "rem")
23 , (6, L, "+"), (6, L, "-")
23 , (6, L, "+"), (6, L, "-")