on master help sign in
Essentially eliminate automatically imported modules
commit51c931240ba02da5fe2129b4080ccf86ed0e1e23 authorEvan Czaplicki <info@elm-lang.org> dateTue 4 Nov 2014, 11:54 (12 years ago) parent59c1b38
2 files changed+6−29
src/Elm/Compiler.hs+1−1 src/Metadata/Prelude.hs+5−28
src/Elm/Compiler.hs+1−1
@@ -50,7 +50,7 @@ compile
5050 -> Map.Map PublicModule.Name PublicModule.Interface
5151 -> Either String (PublicModule.Interface, String)
5252compile source interfaces =
53− case Source.build True unwrappedInterfaces source of
53+ case Source.build False unwrappedInterfaces source of
5454 Left docs -> Left . unlines . List.intersperse "" $ map P.render docs
5555 Right modul -> Right (Module.toInterface modul, JS.generate modul)
5656 where
src/Metadata/Prelude.hs+5−28
@@ -16,34 +16,11 @@ type ImportDict =
1616
1717prelude :: ImportDict
1818prelude =
19− Map.unions [ string, text, maybe, openImports ]
20− where
21− importing :: Module.Name -> [Var.Value] -> ImportDict
22− importing name values =
23− Map.singleton name ([], Var.Listing values False)
24−
25− openImports :: ImportDict
26− openImports =
27− Map.fromList $ map (\name -> (name, ([], Var.openListing))) $
28− [ ["Basics"], ["Signal"], ["List"], ["Time"], ["Color"]
29− , ["Graphics","Element"], ["Graphics","Collage"]
30− , ["Native","Ports"], ["Native","Json"]
31− ]
32−
33− maybe :: ImportDict
34− maybe = importing ["Maybe"] [ Var.ADT "Maybe" Var.openListing ]
35−
36− string :: ImportDict
37− string = importing ["String"] [Var.Value "show"]
38−
39− text :: ImportDict
40− text = importing ["Text"] (Var.ADT "Text" (Var.Listing [] False) : values)
41− where
42− values =
43− map Var.Value
44− [ "toText", "leftAligned", "rightAligned", "centered", "justified"
45− , "plainText", "asText", "typeface", "monospace", "bold", "italic"
46− ]
19+ Map.fromList $ map (\name -> (name, ([], Var.openListing))) $
20+ [ -- ["Basics"]
21+ ["Native","Ports"]
22+ , ["Native","Json"]
23+ ]
4724
4825
4926-- ADDING PRELUDE TO A MODULE