@@ -561,23 +561,42 @@ binop
561binop func left right =
561binop func left right =
562 do jsLeft <- generateJsExpr left
562 do jsLeft <- generateJsExpr left
563 jsRight <- generateJsExpr right
563 jsRight <- generateJsExpr right
564− jsExpr (makeExpr func jsLeft jsRight)
564+ jsExpr (binopHelp func jsLeft jsRight)
568-- BINARY OPERATOR HELPERS
568-- BINARY OPERATOR HELPERS
571−makeExpr :: Var.Canonical -> (Expression () -> Expression () -> Expression ())
571+binopHelp :: Var.Canonical -> Expression () -> Expression () -> Expression ()
572−makeExpr qualifiedOp@(Var.Canonical home op) =
572+binopHelp qualifiedOp@(Var.Canonical home op) leftExpr rightExpr =
574 simpleMake left right =
574 simpleMake left right =
575 ref "A2" `call` [ Var.canonical qualifiedOp, left, right ]
575 ref "A2" `call` [ Var.canonical qualifiedOp, left, right ]
577− if home == Var.Module (ModuleName.inCore ["Basics"]) then
577+ if home == basicsModule then
578− Map.findWithDefault simpleMake op basicOps
578+ (Map.findWithDefault simpleMake op basicOps) leftExpr rightExpr
580+ else if op == "::" && (home == listModule || home == listModuleInternals) then
581+ BuiltIn.cons leftExpr rightExpr
580− simpleMake
584+ simpleMake leftExpr rightExpr
587+listModule :: Var.Home
589+ Var.Module (ModuleName.inCore ["List"])
592+listModuleInternals :: Var.Home
593+listModuleInternals =
594+ Var.TopLevel (ModuleName.inCore ["List"])
597+basicsModule :: Var.Home
599+ Var.Module (ModuleName.inCore ["Basics"])
583basicOps :: Map.Map String (Expression () -> Expression () -> Expression ())
602basicOps :: Map.Map String (Expression () -> Expression () -> Expression ())