on master help sign in
Essentially eliminate automatically imported modules
51c9312Evan Czaplicki
src/Elm/Compiler.hs+1−1
@@ -50,7 +50,7 @@ compile
50 -> Map.Map PublicModule.Name PublicModule.Interface
50 -> Map.Map PublicModule.Name PublicModule.Interface
51 -> Either String (PublicModule.Interface, String)
51 -> Either String (PublicModule.Interface, String)
52compile source interfaces =
52compile source interfaces =
53− case Source.build True unwrappedInterfaces source of
53+ case Source.build False unwrappedInterfaces source of
54 Left docs -> Left . unlines . List.intersperse "" $ map P.render docs
54 Left docs -> Left . unlines . List.intersperse "" $ map P.render docs
55 Right modul -> Right (Module.toInterface modul, JS.generate modul)
55 Right modul -> Right (Module.toInterface modul, JS.generate modul)
56 where
56 where
src/Metadata/Prelude.hs+5−28
@@ -16,34 +16,11 @@ type ImportDict =
16
16
17prelude :: ImportDict
17prelude :: ImportDict
18prelude =
18prelude =
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))) $
19+ Map.fromList $ map (\name -> (name, ([], Var.openListing))) $
28− [ ["Basics"], ["Signal"], ["List"], ["Time"], ["Color"]
20+ [ -- ["Basics"]
29− , ["Graphics","Element"], ["Graphics","Collage"]
30− , ["Native","Ports"], ["Native","Json"]
21+ ["Native","Ports"]
31− ]
22+ , ["Native","Json"]
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− ]
23+ ]
47
24
48
25
49-- ADDING PRELUDE TO A MODULE
26-- ADDING PRELUDE TO A MODULE