Skip to content

Commit

Permalink
Stop doing special things for (<<) and (>>)
Browse files Browse the repository at this point in the history
Fixes #1722
  • Loading branch information
evancz committed Jun 15, 2018
1 parent acecae2 commit 6ae0168
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions compiler/src/Generate/JavaScript/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ generateBasicsCall mode home name args =

[elmLeft, elmRight] ->
case name of
"composeL" -> decomposeL mode elmLeft [elmRight]
"composeR" -> decomposeR mode [elmLeft] elmRight
-- NOTE: removed "composeL" and "composeR" because of this issue:
-- https://github.com/elm/compiler/issues/1722
"append" -> append mode elmLeft elmRight
"apL" -> generateJsExpr mode $ apply elmLeft elmRight
"apR" -> generateJsExpr mode $ apply elmRight elmLeft
Expand Down Expand Up @@ -578,30 +578,6 @@ isLiteral expr =
False


decomposeL :: Mode.Mode -> Opt.Expr -> [Opt.Expr] -> JS.Expr
decomposeL mode expr funcs =
case expr of
Opt.Call (Opt.VarGlobal (Opt.Global home "composeL")) [left, func]
| home == ModuleName.basics ->
decomposeL mode left (func:funcs)

_ ->
generateJsExpr mode $
Opt.Function [N.dollar] (foldr apply (Opt.VarLocal N.dollar) (expr:funcs))


decomposeR :: Mode.Mode -> [Opt.Expr] -> Opt.Expr -> JS.Expr
decomposeR mode funcs expr =
case expr of
Opt.Call (Opt.VarGlobal (Opt.Global home "composeR")) [func, right]
| home == ModuleName.basics ->
decomposeR mode (func:funcs) right

_ ->
generateJsExpr mode $
Opt.Function [N.dollar] (foldr apply (Opt.VarLocal N.dollar) (expr:funcs))


apply :: Opt.Expr -> Opt.Expr -> Opt.Expr
apply func value =
case func of
Expand Down

0 comments on commit 6ae0168

Please sign in to comment.