on master help sign in
Switch to having Cmd and Sub live in their own modules
commiteb7feba32bc6946dbef2992581e601dc7d9776ab authorEvan Czaplicki <info@elm-lang.org> dateMon 22 Feb 2016, 01:45 (11 years ago) parent9d47fd5
2 files changed+12−4
src/AST/Variable.hs+2−2 src/Elm/Compiler/Imports.hs+10−2
src/AST/Variable.hs+2−2
@@ -72,12 +72,12 @@ inCore home name =
7272
7373cmd :: Canonical
7474cmd =
75− inCore ["Platform"] "Cmd"
75+ inCore ["Platform","Cmd"] "Cmd"
7676
7777
7878sub :: Canonical
7979sub =
80− inCore ["Platform"] "Sub"
80+ inCore ["Platform","Sub"] "Sub"
8181
8282
8383
src/Elm/Compiler/Imports.hs+10−2
@@ -17,7 +17,9 @@ defaults =
1717 , ["List"] ==> exposing [Var.Value "::"]
1818 , ["Maybe"] ==> exposing [Var.Union "Maybe" Var.openListing]
1919 , ["Result"] ==> exposing [Var.Union "Result" Var.openListing]
20− , ["Platform"] ==> exposing (map closedType ["Cmd", "Sub", "Program"])
20+ , ["Platform"] ==> exposing [closedType "Program"]
21+ , ["Platform","Cmd"] ==> named "Cmd" [closedType "Cmd", Var.Value "!"]
22+ , ["Platform","Sub"] ==> named "Sub" [closedType "Sub"]
2123 ]
2224
2325
@@ -28,4 +30,10 @@ exposing vars =
2830
2931closedType :: String -> Var.Value
3032closedType name =
31− Var.Union name Var.closedListing
33+ Var.Union name Var.closedListing
34+
35+
36+named :: String -> [Var.Value] -> Module.ImportMethod
37+named name vars =
38+ Module.ImportMethod (Just name) (Var.listing vars)
39+