on master help sign in
Update builder/* for new Elm.ModuleName module
commitc31b96d9bcad4b9d8ede9a262761ecc1b69a7cf1 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 26 Nov 2018, 11:04 (8 years ago) parent2ecbee3
21 files changed+185−188
builder/src/Deps/Diff.hs+4−4 builder/src/Deps/Verify.hs+11−10 builder/src/Elm/Diff.hs+3−3 builder/src/Elm/Project/Json.hs+7−7 builder/src/Elm/Project/Summary.hs+12−12 builder/src/File/Args.hs+2−2 builder/src/File/Artifacts.hs+9−9 builder/src/File/Compile.hs+13−13 builder/src/File/Crawl.hs+21−21 builder/src/File/Find.hs+10−10 builder/src/File/Header.hs+11−12 builder/src/File/Plan.hs+15−15 builder/src/Generate/Nitpick.hs+1−1 builder/src/Generate/Output.hs+8−10 builder/src/Reporting/Exit.hs+2−2 builder/src/Reporting/Exit/Compile.hs+5−5 builder/src/Reporting/Exit/Crawl.hs+36−36 builder/src/Reporting/Exit/Make.hs+3−3 builder/src/Reporting/Progress.hs+3−3 builder/src/Stuff/Paths.hs+6−6 builder/src/Stuff/Verify.hs+3−4
builder/src/Deps/Diff.hs+4−4
@@ -21,9 +21,9 @@ import qualified Data.Name as Name
2121import qualified Data.Set as Set
2222import qualified Data.Text as Text
2323
24−import qualified Elm.Compiler.Module as Module
2524import qualified Elm.Compiler.Type as Type
2625import qualified Elm.Docs as Docs
26+import qualified Elm.ModuleName as ModuleName
2727import qualified Elm.Package as Pkg
2828
2929
@@ -33,9 +33,9 @@ import qualified Elm.Package as Pkg
3333
3434data PackageChanges =
3535 PackageChanges
36− { _modules_added :: [Module.Raw]
37− , _modules_changed :: Map.Map Module.Raw ModuleChanges
38− , _modules_removed :: [Module.Raw]
36+ { _modules_added :: [ModuleName.Raw]
37+ , _modules_changed :: Map.Map ModuleName.Raw ModuleChanges
38+ , _modules_removed :: [ModuleName.Raw]
3939 }
4040
4141
builder/src/Deps/Verify.hs+11−10
@@ -16,9 +16,10 @@ import Data.Set (Set)
1616import System.Directory (doesDirectoryExist)
1717import System.FilePath ((</>))
1818
19−import qualified Elm.Compiler.Module as Module
2019import qualified Elm.Compiler.Objects as Obj
2120import qualified Elm.Docs as Docs
21+import qualified Elm.Interface as I
22+import qualified Elm.ModuleName as ModuleName
2223import Elm.Package (Name, Version)
2324import qualified Elm.PerUserCache as PerUserCache
2425import Elm.Project.Json (Project(..), AppInfo(..), PkgInfo(..))
@@ -176,12 +177,12 @@ verifyBuildArtifacts solution =
176177
177178
178179data RawInfo =
179− RawInfo (Map Name PkgInfo) Module.Interfaces
180+ RawInfo (Map Name PkgInfo) I.Interfaces
180181
181182
182183verifyBuild
183184 :: MVar (Map Name (MVar Answer))
184− -> MVar Module.Interfaces
185+ -> MVar I.Interfaces
185186 -> Name
186187 -> Version
187188 -> Task.Task (MVar Answer)
@@ -266,8 +267,8 @@ getIface
266267 -> Version
267268 -> PkgInfo
268269 -> Map Name PkgInfo
269− -> Module.Interfaces
270− -> Task.Task Module.Interfaces
270+ -> I.Interfaces
271+ -> Task.Task I.Interfaces
271272getIface name version info infos depIfaces =
272273 do root <- Task.getPackageCacheDirFor name version
273274 let solution = Map.map _pkg_version infos
@@ -328,8 +329,8 @@ updateCache
328329 -> PkgInfo
329330 -> Map Name Version
330331 -> Crawl.Result
331− -> Map Module.Raw Compiler.Artifacts
332− -> Task.Task Module.Interfaces
332+ -> Map ModuleName.Raw Compiler.Artifacts
333+ -> Task.Task I.Interfaces
333334updateCache root name info solution graph results =
334335 do let path = root </> "cached.dat"
335336 let deps = Map.map Set.singleton solution
@@ -360,17 +361,17 @@ updateCache root name info solution graph results =
360361-- CRUSH INTERFACES
361362
362363
363−crush :: Name -> PkgInfo -> Map Module.Raw Compiler.Artifacts -> Module.Interfaces
364+crush :: Name -> PkgInfo -> Map ModuleName.Raw Compiler.Artifacts -> I.Interfaces
364365crush pkg info results =
365366 let
366367 exposed =
367368 Set.fromList (Project.getExposed info)
368369 in
369− Map.mapKeys (Module.Canonical pkg) $
370+ Map.mapKeys (ModuleName.Canonical pkg) $
370371 Map.mapMaybeWithKey (crushHelp exposed) results
371372
372373
373−crushHelp :: Set Module.Raw -> Module.Raw -> Compiler.Artifacts -> Maybe Module.Interface
374+crushHelp :: Set ModuleName.Raw -> ModuleName.Raw -> Compiler.Artifacts -> Maybe I.Interface
374375crushHelp exposed name (Compiler.Artifacts elmi _ _) =
375376 if Set.member name exposed then
376377 Just elmi
builder/src/Elm/Diff.hs+3−3
@@ -16,9 +16,9 @@ import qualified Data.Name as Name
1616import qualified Deps.Cache as Cache
1717import Deps.Diff (PackageChanges(..), ModuleChanges(..), Changes(..), Magnitude(..))
1818import qualified Deps.Diff as Diff
19−import qualified Elm.Compiler.Module as Module
2019import qualified Elm.Compiler.Type as Type
2120import qualified Elm.Docs as Docs
21+import qualified Elm.ModuleName as ModuleName
2222import qualified Elm.Package as Pkg
2323import qualified Elm.Project as Project
2424import qualified Elm.Project.Json as Project
@@ -142,13 +142,13 @@ toDoc localizer changes@(PackageChanges added changed removed) =
142142 addedChunk =
143143 if null added then [] else
144144 [ Chunk "ADDED MODULES" MINOR $
145− D.vcat $ map (D.fromString . Module.nameToString) added
145+ D.vcat $ map (D.fromString . ModuleName.nameToString) added
146146 ]
147147
148148 removedChunk =
149149 if null removed then [] else
150150 [ Chunk "REMOVED MODULES" MAJOR $
151− D.vcat $ map (D.fromString . Module.nameToString) removed
151+ D.vcat $ map (D.fromString . ModuleName.nameToString) removed
152152 ]
153153
154154 chunks =
builder/src/Elm/Project/Json.hs+7−7
@@ -31,7 +31,7 @@ import qualified Data.Text as Text
3131import qualified System.Directory as Dir
3232import System.FilePath ((</>))
3333
34−import qualified Elm.Compiler.Module as Module
34+import qualified Elm.ModuleName as ModuleName
3535import qualified Elm.Package as Pkg
3636import Elm.Package (Name, Version)
3737
@@ -86,8 +86,8 @@ data PkgInfo =
8686
8787
8888data Exposed
89− = ExposedList [Module.Raw]
90− | ExposedDict [(Text, [Module.Raw])]
89+ = ExposedList [ModuleName.Raw]
90+ | ExposedDict [(Text, [ModuleName.Raw])]
9191
9292
9393
@@ -127,7 +127,7 @@ getName project =
127127 _pkg_name info
128128
129129
130−getExposed :: PkgInfo -> [Module.Raw]
130+getExposed :: PkgInfo -> [ModuleName.Raw]
131131getExposed info =
132132 case _pkg_exposed info of
133133 ExposedList modules ->
@@ -218,7 +218,7 @@ encodeExposed exposed =
218218 E.object (map (fmap (E.list encodeModule)) chunks)
219219
220220
221−encodeModule :: Module.Raw -> E.Value
221+encodeModule :: ModuleName.Raw -> E.Value
222222encodeModule name =
223223 E.name name
224224
@@ -408,9 +408,9 @@ exposedDecoder =
408408 ]
409409
410410
411−moduleDecoder :: Decoder Module.Raw
411+moduleDecoder :: Decoder ModuleName.Raw
412412moduleDecoder =
413− D.mapError E.BadModuleName Module.decoder
413+ D.mapError E.BadModuleName ModuleName.decoder
414414
415415
416416checkHeader :: Text -> Decoder ()
builder/src/Elm/Project/Summary.hs+12−12
@@ -12,10 +12,10 @@ module Elm.Project.Summary
1212import Prelude hiding (init)
1313import qualified Data.List as List
1414import qualified Data.Map as Map
15−import Data.Map (Map)
1615
17−import qualified Elm.Compiler.Module as Module
18−import Elm.Package (Package(..), Name, Version)
16+import qualified Elm.Interface as I
17+import qualified Elm.ModuleName as ModuleName
18+import qualified Elm.Package as Pkg
1919import Elm.Project.Json (Project(..), AppInfo(..), PkgInfo(..))
2020import qualified Elm.Project.Json as Project
2121
@@ -29,24 +29,24 @@ data Summary =
2929 { _root :: FilePath
3030 , _project :: Project
3131 , _exposed :: ExposedModules
32− , _ifaces :: Module.Interfaces
32+ , _ifaces :: I.Interfaces
3333 , _depsGraph :: DepsGraph
3434 }
3535
3636
3737type ExposedModules =
38− Map.Map Module.Raw [Package]
38+ Map.Map ModuleName.Raw [Pkg.Canonical]
3939
4040
4141type DepsGraph =
42− Map.Map Name ( Version, [Name] )
42+ Map.Map Pkg.Name ( Pkg.Version, [Pkg.Name] )
4343
4444
4545
4646-- MAKE SUMMARY
4747
4848
49−init :: FilePath -> Project -> Map Name PkgInfo -> Module.Interfaces -> Summary
49+init :: FilePath -> Project -> Map.Map Pkg.Name PkgInfo -> I.Interfaces -> Summary
5050init root project deps ifaces =
5151 let
5252 exposed =
@@ -66,8 +66,8 @@ init root project deps ifaces =
6666 Summary root project exposed privatizedInterfaces depsGraph
6767
6868
69−privatize :: ExposedModules -> Module.Canonical -> Module.Interface -> Maybe Module.Interface
70−privatize exposed (Module.Canonical _ name) iface =
69+privatize :: ExposedModules -> ModuleName.Canonical -> I.Interface -> Maybe I.Interface
70+privatize exposed (ModuleName.Canonical _ name) iface =
7171 case Map.lookup name exposed of
7272 Just [_] ->
7373 Just iface
@@ -85,12 +85,12 @@ toNode (PkgInfo name _ _ version _ deps _ _) graph =
8585-- MAKE CHEAP SUMMARY
8686
8787
88−cheapInit :: FilePath -> PkgInfo -> Map Name PkgInfo -> Module.Interfaces -> Summary
88+cheapInit :: FilePath -> PkgInfo -> Map.Map Pkg.Name PkgInfo -> I.Interfaces -> Summary
8989cheapInit root info deps ifaces =
9090 Summary root (Pkg info) (getExposed deps (_pkg_deps info)) ifaces Map.empty
9191
9292
93−getExposed :: Map Name PkgInfo -> Map Name a -> ExposedModules
93+getExposed :: Map.Map Pkg.Name PkgInfo -> Map.Map Pkg.Name a -> ExposedModules
9494getExposed deps directs =
9595 Map.foldl insertExposed Map.empty (Map.intersection deps directs)
9696
@@ -99,7 +99,7 @@ insertExposed :: ExposedModules -> PkgInfo -> ExposedModules
9999insertExposed exposed info =
100100 let
101101 home =
102− Package (_pkg_name info) (_pkg_version info)
102+ Pkg.Canonical (_pkg_name info) (_pkg_version info)
103103
104104 insertModule dict modul =
105105 Map.insertWith (++) modul [home] dict
builder/src/File/Args.hs+2−2
@@ -7,7 +7,7 @@ module File.Args
77 where
88
99
10−import qualified Elm.Compiler.Module as Module
10+import qualified Elm.ModuleName as ModuleName
1111import qualified Elm.Project.Json as Project
1212import qualified Elm.Project.Summary as Summary
1313import qualified Reporting.Exit as Exit
@@ -16,7 +16,7 @@ import qualified Reporting.Task as Task
1616
1717
1818data Args root
19− = Pkg [Module.Raw]
19+ = Pkg [ModuleName.Raw]
2020 | Roots root [root]
2121
2222
builder/src/File/Artifacts.hs+9−9
@@ -17,8 +17,8 @@ import qualified Data.Maybe as Maybe
1717import qualified Data.Text.Encoding as Text
1818
1919import qualified Elm.Compiler as Compiler
20−import qualified Elm.Compiler.Module as Module
2120import qualified Elm.Docs as Docs
21+import qualified Elm.ModuleName as ModuleName
2222import qualified Json.Encode as Encode
2323
2424import File.Compile (Answer(..))
@@ -32,7 +32,7 @@ import qualified Stuff.Paths as Path
3232-- IGNORE
3333
3434
35−ignore :: Map Module.Raw Answer -> Task.Task (Map Module.Raw Compiler.Artifacts)
35+ignore :: Map ModuleName.Raw Answer -> Task.Task (Map ModuleName.Raw Compiler.Artifacts)
3636ignore answers =
3737 let
3838 ignorer _name result =
@@ -45,7 +45,7 @@ ignore answers =
4545-- WRITE
4646
4747
48−write :: FilePath -> Map Module.Raw Answer -> Task.Task (Map Module.Raw Compiler.Artifacts)
48+write :: FilePath -> Map ModuleName.Raw Answer -> Task.Task (Map ModuleName.Raw Compiler.Artifacts)
4949write root answers =
5050 let
5151 writer name result@(Compiler.Artifacts elmi elmo _) =
@@ -60,7 +60,7 @@ write root answers =
6060 liftIO $ traverse readMVar mvars
6161
6262
63−writeDocs :: Map Module.Raw Compiler.Artifacts -> FilePath -> Task.Task Docs.Documentation
63+writeDocs :: Map ModuleName.Raw Compiler.Artifacts -> FilePath -> Task.Task Docs.Documentation
6464writeDocs results path =
6565 let
6666 getDocs (Compiler.Artifacts _ _ docs) =
@@ -79,7 +79,7 @@ writeDocs results path =
7979-- GATHER
8080
8181
82−gather :: OnGood a -> Map Module.Raw Answer -> Task.Task (Map Module.Raw a)
82+gather :: OnGood a -> Map ModuleName.Raw Answer -> Task.Task (Map ModuleName.Raw a)
8383gather onGood answers =
8484 do summary <- liftIO $
8585 foldM (gatherHelp onGood) (Right Map.empty) (Map.toList answers)
@@ -92,10 +92,10 @@ gather onGood answers =
9292 return results
9393
9494
95−type OnGood a = Module.Raw -> Compiler.Artifacts -> IO a
95+type OnGood a = ModuleName.Raw -> Compiler.Artifacts -> IO a
9696
9797
98−gatherHelp :: OnGood a -> Summary a -> (Module.Raw, Answer) -> IO (Summary a)
98+gatherHelp :: OnGood a -> Summary a -> (ModuleName.Raw, Answer) -> IO (Summary a)
9999gatherHelp onGood summary (name, answer) =
100100 case answer of
101101 Blocked ->
@@ -115,10 +115,10 @@ gatherHelp onGood summary (name, answer) =
115115
116116
117117type Summary a =
118− Either (E.Exit, [E.Exit]) (Map Module.Raw a)
118+ Either (E.Exit, [E.Exit]) (Map ModuleName.Raw a)
119119
120120
121−addOk :: Module.Raw -> a -> Summary a -> Summary a
121+addOk :: ModuleName.Raw -> a -> Summary a -> Summary a
122122addOk name result acc =
123123 case acc of
124124 Left _ ->
builder/src/File/Compile.hs+13−13
@@ -13,8 +13,8 @@ import qualified Data.Map as Map
1313import qualified Data.Time.Clock as Time
1414
1515import qualified Elm.Compiler as Compiler
16−import qualified Elm.Compiler.Module as Module
17−
16+import qualified Elm.Interface as I
17+import qualified Elm.ModuleName as ModuleName
1818import Elm.Project.Json (Project)
1919import qualified Elm.Project.Json as Project
2020import qualified File.Plan as Plan
@@ -26,7 +26,7 @@ import qualified Reporting.Task as Task
2626-- COMPILE
2727
2828
29−compile :: Project -> Maybe FilePath -> Module.Interfaces -> Dict Plan.Info -> Task.Task (Dict Answer)
29+compile :: Project -> Maybe FilePath -> I.Interfaces -> Dict Plan.Info -> Task.Task (Dict Answer)
3030compile project maybeDocsPath ifaces modules =
3131 do Task.report (Progress.CompileStart (Map.size modules))
3232
@@ -54,7 +54,7 @@ data Answer
5454 | Good Compiler.Artifacts
5555
5656
57−type Dict a = Map.Map Module.Raw a
57+type Dict a = Map.Map ModuleName.Raw a
5858
5959
6060
@@ -66,8 +66,8 @@ compileModule
6666 -> Project
6767 -> Maybe FilePath
6868 -> MVar (Dict (MVar Answer))
69− -> MVar Module.Interfaces
70− -> Module.Raw
69+ -> MVar I.Interfaces
70+ -> ModuleName.Raw
7171 -> Plan.Info
7272 -> IO (MVar Answer)
7373compileModule tell project maybeDocsPath answersMVar ifacesMVar name info =
@@ -94,7 +94,7 @@ compileModule tell project maybeDocsPath answersMVar ifacesMVar name info =
9494
9595 (_warnings, Right result@(Compiler.Artifacts elmi _ _)) ->
9696 do tell (Progress.CompileFileEnd name Progress.Good)
97− let canonicalName = Module.Canonical pkg name
97+ let canonicalName = ModuleName.Canonical pkg name
9898 lock <- takeMVar ifacesMVar
9999 putMVar ifacesMVar (Map.insert canonicalName elmi lock)
100100 putMVar mvar (Good result)
@@ -106,7 +106,7 @@ compileModule tell project maybeDocsPath answersMVar ifacesMVar name info =
106106-- TO DOCS FLAG
107107
108108
109−toDocsFlag :: Module.Raw -> Project -> Maybe FilePath -> Compiler.DocsFlag
109+toDocsFlag :: ModuleName.Raw -> Project -> Maybe FilePath -> Compiler.DocsFlag
110110toDocsFlag name project maybeDocsPath =
111111 case maybeDocsPath of
112112 Nothing ->
@@ -124,7 +124,7 @@ toDocsFlag name project maybeDocsPath =
124124 Compiler.NoDocs
125125
126126
127−isExposed :: Module.Raw -> Project.Exposed -> Bool
127+isExposed :: ModuleName.Raw -> Project.Exposed -> Bool
128128isExposed name exposed =
129129 case exposed of
130130 Project.ExposedList modules ->
@@ -138,16 +138,16 @@ isExposed name exposed =
138138-- IMPORTS
139139
140140
141−makeImports :: Project -> Plan.Info -> Dict Module.Canonical
141+makeImports :: Project -> Plan.Info -> Dict ModuleName.Canonical
142142makeImports project (Plan.Info _ _ _ clean dirty foreign) =
143143 let
144144 pkgName =
145145 Project.getName project
146146
147147 mkLocal name =
148− ( name, Module.Canonical pkgName name )
148+ ( name, ModuleName.Canonical pkgName name )
149149
150− mkForeign canonicalName@(Module.Canonical _ name) =
150+ mkForeign canonicalName@(ModuleName.Canonical _ name) =
151151 ( name, canonicalName )
152152 in
153153 Map.fromList $
@@ -165,7 +165,7 @@ isBlocked answers info =
165165 anyBlock <$> traverse (get answers) (Plan._dirty info)
166166
167167
168−get :: Dict (MVar Answer) -> Module.Raw -> IO Answer
168+get :: Dict (MVar Answer) -> ModuleName.Raw -> IO Answer
169169get names name =
170170 case Map.lookup name names of
171171 Nothing ->
builder/src/File/Crawl.hs+21−21
@@ -16,9 +16,9 @@ import qualified Data.Graph as Graph
1616import qualified Data.Map as Map
1717import qualified Data.Set as Set
1818
19−import qualified Elm.Compiler.Module as Module
2019import qualified Elm.Compiler.Objects as Obj
2120import qualified Elm.Kernel as Kernel
21+import qualified Elm.ModuleName as ModuleName
2222import qualified Elm.Package as Pkg
2323
2424import qualified Elm.Project.Json as Project
@@ -38,10 +38,10 @@ import qualified Reporting.Task as Task
3838
3939data Graph kernel problems =
4040 Graph
41− { _args :: Args.Args Module.Raw
42− , _locals :: Map.Map Module.Raw Header.Info
43− , _kernels :: Map.Map Module.Raw kernel
44− , _foreigns :: Map.Map Module.Raw Pkg.Package
41+ { _args :: Args.Args ModuleName.Raw
42+ , _locals :: Map.Map ModuleName.Raw Header.Info
43+ , _kernels :: Map.Map ModuleName.Raw kernel
44+ , _foreigns :: Map.Map ModuleName.Raw Pkg.Canonical
4545 , _problems :: problems
4646 }
4747
@@ -54,7 +54,7 @@ type WorkGraph =
5454 Graph (FilePath, Maybe FilePath) [E.Problem]
5555
5656
57−initWorkGraph :: Args.Args Module.Raw -> Map.Map Module.Raw Header.Info -> WorkGraph
57+initWorkGraph :: Args.Args ModuleName.Raw -> Map.Map ModuleName.Raw Header.Info -> WorkGraph
5858initWorkGraph args locals =
5959 Graph args locals Map.empty Map.empty []
6060
@@ -90,7 +90,7 @@ crawlFromSource summary@(Summary _ project _ _ _) source =
9090 Header.readSource project source
9191
9292
93−crawlHelp :: Summary -> ( Maybe Module.Raw, Header.Info ) -> Task.Task Result
93+crawlHelp :: Summary -> ( Maybe ModuleName.Raw, Header.Info ) -> Task.Task Result
9494crawlHelp summary ( maybeName, info@(Header.Info path _ _ deps) ) =
9595 do let name = maybe "Main" id maybeName
9696 let toUnvisited dep = Unvisited (maybe (E.File path) (E.Module path) maybeName) dep
@@ -124,7 +124,7 @@ depthFirstSearch summary unvisited startGraph =
124124-- CHECK FOR CYCLES
125125
126126
127−checkForCycles :: Map.Map Module.Raw Header.Info -> Task.Task ()
127+checkForCycles :: Map.Map ModuleName.Raw Header.Info -> Task.Task ()
128128checkForCycles locals =
129129 let
130130 toNode (name, Header.Info _ _ _ imports) =
@@ -136,7 +136,7 @@ checkForCycles locals =
136136 mapM_ checkComponent components
137137
138138
139−checkComponent :: Graph.SCC Module.Raw -> Task.Task ()
139+checkComponent :: Graph.SCC ModuleName.Raw -> Task.Task ()
140140checkComponent scc =
141141 case scc of
142142 Graph.AcyclicSCC _ ->
@@ -154,7 +154,7 @@ dfs
154154 :: Summary
155155 -> Chan (Either E.Problem Asset)
156156 -> Int
157− -> Set.Set Module.Raw
157+ -> Set.Set ModuleName.Raw
158158 -> [Unvisited]
159159 -> WorkGraph
160160 -> Task.Task WorkGraph
@@ -194,9 +194,9 @@ dfs summary chan oldPending oldSeen unvisited graph =
194194spawnVisitor
195195 :: Summary
196196 -> Chan (Either E.Problem Asset)
197− -> (Set.Set Module.Raw, Int)
197+ -> (Set.Set ModuleName.Raw, Int)
198198 -> Unvisited
199− -> Task.Task (Set.Set Module.Raw, Int)
199+ -> Task.Task (Set.Set ModuleName.Raw, Int)
200200spawnVisitor summary chan (seen, n) unvisited@(Unvisited _ name) =
201201 if Set.member name seen then
202202 return (seen, n)
@@ -212,14 +212,14 @@ spawnVisitor summary chan (seen, n) unvisited@(Unvisited _ name) =
212212data Unvisited =
213213 Unvisited
214214 { _origin :: E.Origin
215− , _name :: Module.Raw
215+ , _name :: ModuleName.Raw
216216 }
217217
218218
219219data Asset
220− = Local Module.Raw Header.Info
221− | Kernel Module.Raw (FilePath, Maybe FilePath)
222− | Foreign Module.Raw Pkg.Package
220+ = Local ModuleName.Raw Header.Info
221+ | Kernel ModuleName.Raw (FilePath, Maybe FilePath)
222+ | Foreign ModuleName.Raw Pkg.Canonical
223223 | ForeignKernel
224224
225225
@@ -246,9 +246,9 @@ toVisitor summary (Unvisited origin name) =
246246
247247visitKernels
248248 :: Summary
249− -> Map.Map Module.Raw Header.Info
250− -> Map.Map Module.Raw (FilePath, Maybe FilePath)
251− -> Task.Task (Map.Map Module.Raw Obj.Kernel)
249+ -> Map.Map ModuleName.Raw Header.Info
250+ -> Map.Map ModuleName.Raw (FilePath, Maybe FilePath)
251+ -> Task.Task (Map.Map ModuleName.Raw Obj.Kernel)
252252visitKernels summary locals kernelPaths =
253253 if Map.null kernelPaths then
254254 return Map.empty
@@ -281,10 +281,10 @@ readKContent importDict path =
281281
282282
283283type ImportDict =
284− Map.Map Module.Raw [Pkg.Name]
284+ Map.Map ModuleName.Raw [Pkg.Name]
285285
286286
287−toImportDict :: Summary -> Map.Map Module.Raw info -> ImportDict
287+toImportDict :: Summary -> Map.Map ModuleName.Raw info -> ImportDict
288288toImportDict (Summary _ project exposed _ _) locals =
289289 let
290290 localPkg =
builder/src/File/Find.hs+10−10
@@ -14,7 +14,7 @@ import qualified System.FilePath as FP
1414import qualified System.Directory as Dir
1515import System.FilePath ((</>), (<.>))
1616
17−import qualified Elm.Compiler.Module as Module
17+import qualified Elm.ModuleName as ModuleName
1818import qualified Elm.Package as Pkg
1919
2020import qualified Elm.Project.Json as Project
@@ -30,7 +30,7 @@ import qualified Reporting.Task as Task
3030data Asset
3131 = Local FilePath
3232 | Kernel FilePath (Maybe FilePath)
33− | Foreign Pkg.Package
33+ | Foreign Pkg.Canonical
3434 | ForeignKernel
3535
3636
@@ -38,7 +38,7 @@ data Asset
3838-- FIND
3939
4040
41−find :: Summary.Summary -> E.Origin -> Module.Raw -> Task.Task_ E.Problem Asset
41+find :: Summary.Summary -> E.Origin -> ModuleName.Raw -> Task.Task_ E.Problem Asset
4242find (Summary.Summary root project exposed _ _) origin name =
4343 do here <- liftIO Dir.getCurrentDirectory
4444 let toRoot dir = FP.makeRelative here (root </> dir)
@@ -62,7 +62,7 @@ find (Summary.Summary root project exposed _ _) origin name =
6262-- FIND ELM
6363
6464
65−findElm :: Project.Project -> [FilePath] -> Summary.ExposedModules -> E.Origin -> Module.Raw -> Task.Task_ E.Problem Asset
65+findElm :: Project.Project -> [FilePath] -> Summary.ExposedModules -> E.Origin -> ModuleName.Raw -> Task.Task_ E.Problem Asset
6666findElm project srcDirs exposed origin name =
6767 do
6868 paths <- liftIO $ Maybe.catMaybes <$> mapM (elmExists name) srcDirs
@@ -86,9 +86,9 @@ findElm project srcDirs exposed origin name =
8686 Task.throw $ E.ModuleAmbiguous origin name paths (maybe [] id maybePkgs)
8787
8888
89−elmExists :: Module.Raw -> FilePath -> IO (Maybe FilePath)
89+elmExists :: ModuleName.Raw -> FilePath -> IO (Maybe FilePath)
9090elmExists name srcDir =
91− do let path = srcDir </> Module.nameToSlashPath name <.> "elm"
91+ do let path = srcDir </> ModuleName.nameToSlashPath name <.> "elm"
9292 exists <- Dir.doesFileExist path
9393 return $ if exists then Just path else Nothing
9494
@@ -97,17 +97,17 @@ elmExists name srcDir =
9797-- FIND KERNEL
9898
9999
100−findKernel :: FilePath -> Summary.ExposedModules -> E.Origin -> Module.Raw -> Task.Task_ E.Problem Asset
100+findKernel :: FilePath -> Summary.ExposedModules -> E.Origin -> ModuleName.Raw -> Task.Task_ E.Problem Asset
101101findKernel srcDir exposed origin name =
102− do let clientPath = srcDir </> Module.nameToSlashPath name <.> "js"
103− let serverPath = srcDir </> Module.nameToSlashPath name <.> "server.js"
102+ do let clientPath = srcDir </> ModuleName.nameToSlashPath name <.> "js"
103+ let serverPath = srcDir </> ModuleName.nameToSlashPath name <.> "server.js"
104104 client <- liftIO $ Dir.doesFileExist clientPath
105105 server <- liftIO $ Dir.doesFileExist serverPath
106106 if client
107107 then return $ Kernel clientPath (if server then Just serverPath else Nothing)
108108 else
109109 case Map.lookup (Name.getKernel name) exposed of
110− Just [Pkg.Package pkg _vsn] | pkg == Pkg.core || pkg == Pkg.virtualDom ->
110+ Just [Pkg.Canonical pkg _vsn] | pkg == Pkg.core || pkg == Pkg.virtualDom ->
111111 return ForeignKernel
112112
113113 _ ->
builder/src/File/Header.hs+11−12
@@ -16,9 +16,8 @@ import qualified Data.Time.Calendar as Day
1616import qualified Data.Time.Clock as Time
1717import qualified System.Directory as Dir
1818
19−import qualified Elm.Compiler.Module as Module
2019import qualified Elm.Header as Header
21−
20+import qualified Elm.ModuleName as ModuleName
2221import qualified Elm.Project.Json as Project
2322import Elm.Project.Json (Project)
2423import Elm.Project.Summary (Summary(..))
@@ -37,7 +36,7 @@ data Info =
3736 { _path :: FilePath
3837 , _time :: Time.UTCTime
3938 , _source :: BS.ByteString
40− , _imports :: [Module.Raw]
39+ , _imports :: [ModuleName.Raw]
4140 }
4241
4342
@@ -49,7 +48,7 @@ atRoot task =
4948-- READ MODULE
5049
5150
52−readModule :: Summary -> Module.Raw -> FilePath -> Task.Task_ E.Problem (Module.Raw, Info)
51+readModule :: Summary -> ModuleName.Raw -> FilePath -> Task.Task_ E.Problem (ModuleName.Raw, Info)
5352readModule summary expectedName path =
5453 do time <- liftIO $ Dir.getModificationTime path
5554 source <- liftIO $ IO.readUtf8 path
@@ -58,7 +57,7 @@ readModule summary expectedName path =
5857 return (name, info)
5958
6059
61−checkName :: FilePath -> Module.Raw -> Maybe Module.Raw -> Task.Task_ E.Problem Module.Raw
60+checkName :: FilePath -> ModuleName.Raw -> Maybe ModuleName.Raw -> Task.Task_ E.Problem ModuleName.Raw
6261checkName path expectedName maybeName =
6362 case maybeName of
6463 Nothing ->
@@ -74,7 +73,7 @@ checkName path expectedName maybeName =
7473-- READ ONE FILE
7574
7675
77−readOneFile :: Summary -> FilePath -> Task.Task (Maybe Module.Raw, Info)
76+readOneFile :: Summary -> FilePath -> Task.Task (Maybe ModuleName.Raw, Info)
7877readOneFile summary path =
7978 Task.mapError Exit.Crawl $
8079 do (time, source) <- readOneHelp path
@@ -93,7 +92,7 @@ readOneHelp path =
9392-- READ MANY FILES
9493
9594
96−readManyFiles :: Summary -> FilePath -> [FilePath] -> Task.Task ((Module.Raw, Info), [(Module.Raw, Info)])
95+readManyFiles :: Summary -> FilePath -> [FilePath] -> Task.Task ((ModuleName.Raw, Info), [(ModuleName.Raw, Info)])
9796readManyFiles summary file files =
9897 Task.mapError Exit.Crawl $
9998 do info <- readManyFilesHelp summary file
@@ -106,7 +105,7 @@ readManyFiles summary file files =
106105 insert (k,v) dict = Map.insertWith append k (v, []) dict
107106
108107
109−readManyFilesHelp :: Summary -> FilePath -> Task.Task_ E.Exit (Module.Raw, Info)
108+readManyFilesHelp :: Summary -> FilePath -> Task.Task_ E.Exit (ModuleName.Raw, Info)
110109readManyFilesHelp summary path =
111110 do (time, source) <- readOneHelp path
112111 (maybeName, info) <- atRoot $ parse (_project summary) path time source
@@ -118,7 +117,7 @@ readManyFilesHelp summary path =
118117 return (name, info)
119118
120119
121−detectDuplicateNames :: Module.Raw -> (Info, [Info]) -> Task.Task_ E.Exit ()
120+detectDuplicateNames :: ModuleName.Raw -> (Info, [Info]) -> Task.Task_ E.Exit ()
122121detectDuplicateNames name (info, otherInfos) =
123122 case otherInfos of
124123 [] ->
@@ -133,7 +132,7 @@ detectDuplicateNames name (info, otherInfos) =
133132-- READ SOURCE
134133
135134
136−readSource :: Project -> BS.ByteString -> Task.Task (Maybe Module.Raw, Info)
135+readSource :: Project -> BS.ByteString -> Task.Task (Maybe ModuleName.Raw, Info)
137136readSource project source =
138137 Task.mapError Exit.Crawl $
139138 atRoot $ parse project "elm" fakeTime source
@@ -148,7 +147,7 @@ fakeTime =
148147-- PARSE HEADER
149148
150149
151−parse :: Project -> FilePath -> Time.UTCTime -> BS.ByteString -> Task.Task_ E.Problem (Maybe Module.Raw, Info)
150+parse :: Project -> FilePath -> Time.UTCTime -> BS.ByteString -> Task.Task_ E.Problem (Maybe ModuleName.Raw, Info)
152151parse project path time source =
153152 -- TODO get regions on data extracted here
154153 case Header.parse (Project.getName project) source of
@@ -160,7 +159,7 @@ parse project path time source =
160159 Task.throw (E.BadHeader path time source msg)
161160
162161
163−checkTag :: Project -> FilePath -> Maybe (Header.Tag, Module.Raw) -> Task.Task_ E.Problem (Maybe Module.Raw)
162+checkTag :: Project -> FilePath -> Maybe (Header.Tag, ModuleName.Raw) -> Task.Task_ E.Problem (Maybe ModuleName.Raw)
164163checkTag project path maybeDecl =
165164 case maybeDecl of
166165 Nothing ->
builder/src/File/Plan.hs+15−15
@@ -17,9 +17,9 @@ import qualified Data.Map as Map
1717import qualified Data.Time.Clock as Time
1818import qualified System.Directory as Dir
1919
20−import qualified Elm.Compiler.Module as Module
20+import qualified Elm.Interface as I
21+import qualified Elm.ModuleName as ModuleName
2122import qualified Elm.Package as Pkg
22−
2323import qualified Elm.Project.Json as Project
2424import qualified Elm.Project.Summary as Summary
2525import qualified File.Crawl as Crawl
@@ -32,10 +32,10 @@ import qualified Stuff.Paths
3232-- PLAN
3333
3434
35−type Dict value = Map.Map Module.Raw value
35+type Dict value = Map.Map ModuleName.Raw value
3636
3737
38−plan :: Maybe FilePath -> Summary.Summary -> Crawl.Result -> Task.Task (Dict Info, Module.Interfaces)
38+plan :: Maybe FilePath -> Summary.Summary -> Crawl.Result -> Task.Task (Dict Info, I.Interfaces)
3939plan docs (Summary.Summary root project _ ifaces _) (Crawl.Graph _ locals _ foreigns _) =
4040 liftIO $
4141 do queue <- newChan
@@ -75,9 +75,9 @@ data Info =
7575 { _path :: FilePath
7676 , _time :: Time.UTCTime
7777 , _src :: BS.ByteString
78− , _clean :: [Module.Raw]
79− , _dirty :: [Module.Raw]
80− , _foreign :: [Module.Canonical] -- TODO is this needed?
78+ , _clean :: [ModuleName.Raw]
79+ , _dirty :: [ModuleName.Raw]
80+ , _foreign :: [ModuleName.Canonical] -- TODO is this needed?
8181 }
8282
8383
@@ -88,8 +88,8 @@ data Info =
8888getStatus
8989 :: Env
9090 -> MVar (Dict (MVar Status))
91− -> Dict Pkg.Package
92− -> Module.Raw
91+ -> Dict Pkg.Canonical
92+ -> ModuleName.Raw
9393 -> Header.Info
9494 -> IO (MVar Status)
9595getStatus env statusMVars foreigns name (Header.Info path time src deps) =
@@ -117,7 +117,7 @@ getStatus env statusMVars foreigns name (Header.Info path time src deps) =
117117
118118 if name /= "Main" && freshElmi && freshDocs
119119 then
120− do let canonical = Module.Canonical (_pkg env) name
120+ do let canonical = ModuleName.Canonical (_pkg env) name
121121 writeChan (_queue env) (Get canonical elmi)
122122 return Nothing
123123 else
@@ -128,7 +128,7 @@ getStatus env statusMVars foreigns name (Header.Info path time src deps) =
128128 return mvar
129129
130130
131−addDep :: Dict (MVar Status) -> Dict Pkg.Package -> Info -> Module.Raw -> IO Info
131+addDep :: Dict (MVar Status) -> Dict Pkg.Canonical -> Info -> ModuleName.Raw -> IO Info
132132addDep locals foreigns info name =
133133 case Map.lookup name locals of
134134 Just mvar ->
@@ -142,8 +142,8 @@ addDep locals foreigns info name =
142142
143143 Nothing ->
144144 case Map.lookup name foreigns of
145− Just (Pkg.Package pkg _vsn) ->
146− return $ info { _foreign = Module.Canonical pkg name : _foreign info }
145+ Just (Pkg.Canonical pkg _vsn) ->
146+ return $ info { _foreign = ModuleName.Canonical pkg name : _foreign info }
147147
148148 Nothing ->
149149 return info -- must be native
@@ -185,10 +185,10 @@ remove path =
185185
186186data Msg
187187 = EndLoop (Dict Info)
188− | Get Module.Canonical FilePath
188+ | Get ModuleName.Canonical FilePath
189189
190190
191−ifaceLoader :: Chan Msg -> Module.Interfaces -> IO (Dict Info, Module.Interfaces)
191+ifaceLoader :: Chan Msg -> I.Interfaces -> IO (Dict Info, I.Interfaces)
192192ifaceLoader queue ifaces =
193193 do msg <- readChan queue
194194 case msg of
builder/src/Generate/Nitpick.hs+1−1
@@ -9,7 +9,7 @@ import qualified Data.Name as Name
99import qualified Data.Set as Set
1010
1111import qualified AST.Optimized as Opt
12−import qualified AST.Module.Name as ModuleName
12+import qualified Elm.ModuleName as ModuleName
1313import qualified Elm.Package as Pkg
1414
1515
builder/src/Generate/Output.hs+8−10
@@ -23,12 +23,10 @@ import qualified System.FilePath as FP
2323import System.FilePath ((</>))
2424
2525import qualified Elm.Compiler as Compiler
26−import qualified Elm.Compiler.Module as Module
2726import qualified Elm.Compiler.Objects as Obj
2827import qualified Elm.Interface as I
28+import qualified Elm.ModuleName as ModuleName
2929import qualified Elm.Package as Pkg
30−
31−import qualified AST.Module.Name as ModuleName
3230import qualified Elm.Project.Json as Project
3331import qualified Elm.Project.Summary as Summary
3432import qualified File.Args as Args
@@ -59,7 +57,7 @@ generate
5957 -> Maybe Output
6058 -> Summary.Summary
6159 -> Crawl.Result
62− -> Map.Map Module.Raw Compiler.Artifacts
60+ -> Map.Map ModuleName.Raw Compiler.Artifacts
6361 -> Task.Task ()
6462generate mode target maybeOutput summary graph@(Crawl.Graph args locals _ _ _) artifacts =
6563 case args of
@@ -87,8 +85,8 @@ generate mode target maybeOutput summary graph@(Crawl.Graph args locals _ _ _) a
8785
8886getInterfaces
8987 :: Summary.Summary
90− -> Map.Map Module.Raw a
91− -> Map.Map Module.Raw Compiler.Artifacts
88+ -> Map.Map ModuleName.Raw a
89+ -> Map.Map ModuleName.Raw Compiler.Artifacts
9290 -> Task.Task I.Interfaces
9391getInterfaces (Summary.Summary root project _ interfaces _) locals artifacts =
9492 let
@@ -119,11 +117,11 @@ generateMonolith
119117 -> Maybe Output
120118 -> Summary.Summary
121119 -> Obj.Graph
122− -> [Module.Raw]
120+ -> [ModuleName.Raw]
123121 -> Task.Task ()
124122generateMonolith mode maybeOutput (Summary.Summary _ project _ _ _) graph rootNames =
125123 do let pkg = Project.getName project
126− let roots = map (Module.Canonical pkg) rootNames
124+ let roots = map (ModuleName.Canonical pkg) rootNames
127125 case Obj.generate mode graph roots of
128126 Obj.None ->
129127 return ()
@@ -172,7 +170,7 @@ generateReplFile noColors localizer summary@(Summary.Summary _ project _ _ _) gr
172170 do
173171 objectGraph <- organize summary graph
174172
175− let home = Module.Canonical (Project.getName project) Name.replModule
173+ let home = ModuleName.Canonical (Project.getName project) Name.replModule
176174 let builder = Obj.generateForRepl (not noColors) localizer objectGraph iface home name
177175
178176 liftIO $ IO.writeBuilder (Paths.temp "js") $
@@ -197,7 +195,7 @@ organize (Summary.Summary root _ _ _ deps) (Crawl.Graph _ locals _ _ _) =
197195 return (Obj.union localObjs foreignObjs)
198196
199197
200−loadModuleObj :: FilePath -> Module.Raw -> Task.Task Obj.Graph
198+loadModuleObj :: FilePath -> ModuleName.Raw -> Task.Task Obj.Graph
201199loadModuleObj root name =
202200 IO.readBinary (Paths.elmo root name)
203201
builder/src/Reporting/Exit.hs+2−2
@@ -8,7 +8,7 @@ module Reporting.Exit
88 where
99
1010
11−import qualified Elm.Compiler.Module as Module
11+import qualified Elm.ModuleName as ModuleName
1212import qualified Json.Encode as Encode
1313import qualified Reporting.Doc as D
1414import qualified Reporting.Exit.Assets as Asset
@@ -35,7 +35,7 @@ data Exit
3535 | Bump Bump.Exit
3636 | Compile Compile.Exit [Compile.Exit]
3737 | Crawl Crawl.Exit
38− | Cycle [Module.Raw] -- TODO write docs to help with this scenario
38+ | Cycle [ModuleName.Raw] -- TODO write docs to help with this scenario
3939 | Deps Deps.Exit
4040 | Diff Diff.Exit
4141 | Make Make.Exit
builder/src/Reporting/Exit/Compile.hs+5−5
@@ -13,7 +13,7 @@ import qualified Data.Text as Text
1313import qualified Data.Time.Clock as Time
1414
1515import qualified Elm.Compiler as Compiler
16−import qualified Elm.Compiler.Module as Module
16+import qualified Elm.ModuleName as ModuleName
1717import qualified Json.Encode as Encode
1818import qualified Reporting.Doc as D
1919
@@ -24,7 +24,7 @@ import qualified Reporting.Doc as D
2424
2525data Exit =
2626 Exit
27− { _name :: Module.Raw
27+ { _name :: ModuleName.Raw
2828 , _path :: FilePath
2929 , _time :: Time.UTCTime
3030 , _source :: Text.Text
@@ -68,11 +68,11 @@ exitToDoc (Exit _name path _time source errors) =
6868 Compiler.errorsToDoc path source errors
6969
7070
71−separator :: Module.Raw -> Module.Raw -> D.Doc
71+separator :: ModuleName.Raw -> ModuleName.Raw -> D.Doc
7272separator beforeName afterName =
7373 let
74− before = Module.nameToString beforeName ++ " ↑ "
75− after = " ↓ " ++ Module.nameToString afterName
74+ before = ModuleName.nameToString beforeName ++ " ↑ "
75+ after = " ↓ " ++ ModuleName.nameToString afterName
7676 in
7777 D.dullred $ D.vcat $
7878 [ D.indent (80 - length before) (D.fromString before)
builder/src/Reporting/Exit/Crawl.hs+36−36
@@ -16,7 +16,7 @@ import qualified Data.Text.Encoding as Text
1616import qualified Data.Time.Clock as Time
1717
1818import qualified Elm.Compiler as Compiler
19−import qualified Elm.Compiler.Module as Module
19+import qualified Elm.ModuleName as ModuleName
2020import qualified Elm.Package as Pkg
2121import Reporting.Doc ((<+>), (<>))
2222import qualified Reporting.Doc as D
@@ -30,30 +30,30 @@ import qualified Reporting.Exit.Help as Help
3030
3131data Exit
3232 = RootFileNotFound FilePath
33− | RootModuleNameDuplicate Module.Raw [FilePath]
33+ | RootModuleNameDuplicate ModuleName.Raw [FilePath]
3434 | RootNameless FilePath
3535 | DependencyProblems Problem [Problem]
3636 | BadKernelHeader FilePath
3737
3838
3939data Problem
40− = ModuleNotFound Origin Module.Raw SrcDirs
41− | ModuleAmbiguous Origin Module.Raw [FilePath] [Pkg.Package]
40+ = ModuleNotFound Origin ModuleName.Raw SrcDirs
41+ | ModuleAmbiguous Origin ModuleName.Raw [FilePath] [Pkg.Canonical]
4242 | BadHeader FilePath Time.UTCTime BS.ByteString Compiler.Error
43− | ModuleNameReservedForKernel Origin Module.Raw
44− | ModuleNameMissing FilePath Module.Raw
43+ | ModuleNameReservedForKernel Origin ModuleName.Raw
44+ | ModuleNameMissing FilePath ModuleName.Raw
4545 | ModuleNameMismatch
4646 FilePath
47− Module.Raw -- expected
48− Module.Raw -- actual
49− | PortsInPackage FilePath Module.Raw
50− | EffectsUnexpected FilePath Module.Raw
47+ ModuleName.Raw -- expected
48+ ModuleName.Raw -- actual
49+ | PortsInPackage FilePath ModuleName.Raw
50+ | EffectsUnexpected FilePath ModuleName.Raw
5151
5252
5353data Origin
5454 = ElmJson
5555 | File FilePath
56− | Module FilePath Module.Raw
56+ | Module FilePath ModuleName.Raw
5757
5858
5959data SrcDirs
@@ -82,7 +82,7 @@ toReport exit =
8282 map D.fromString paths
8383 , D.fillSep $
8484 [ "These", "modules", if length paths == 2 then "both" else "all", "claim"
85− , "to", "be", "named", D.dullyellow (D.fromString (Module.nameToString name)) <> "."
85+ , "to", "be", "named", D.dullyellow (D.fromString (ModuleName.nameToString name)) <> "."
8686 , "Change", "them", "to", "have", "unique", "names", "and", "you"
8787 , "should", "be", "all", "set!"
8888 ]
@@ -139,9 +139,9 @@ problemToReport problem =
139139 Help.report "MODULE NAME MISMATCH" (Just path)
140140 ( "The file at " ++ path ++ " has a typo in the module name. It says:"
141141 )
142− [ D.indent 4 $ D.dullyellow $ "module" <+> D.red (D.fromString (Module.nameToString actual)) <+> "exposing (..)"
142+ [ D.indent 4 $ D.dullyellow $ "module" <+> D.red (D.fromString (ModuleName.nameToString actual)) <+> "exposing (..)"
143143 , "Looks like a typo or copy/paste error. Instead it needs to say:"
144− , D.indent 4 $ D.dullyellow $ "module" <+> D.green (D.fromString (Module.nameToString expected)) <+> "exposing (..)"
144+ , D.indent 4 $ D.dullyellow $ "module" <+> D.green (D.fromString (ModuleName.nameToString expected)) <+> "exposing (..)"
145145 , "Make the change and you should be all set!"
146146 ]
147147
@@ -159,7 +159,7 @@ problemToReport problem =
159159 \ cautious in expanding its usage."
160160
161161
162−badTagToDoc :: FilePath -> Module.Raw -> String -> String -> String -> Help.Report
162+badTagToDoc :: FilePath -> ModuleName.Raw -> String -> String -> String -> Help.Report
163163badTagToDoc path name tag hintName summary =
164164 Help.report
165165 ("UNEXPECTED " ++ map Char.toUpper tag ++ " MODULE")
@@ -169,7 +169,7 @@ badTagToDoc path name tag hintName summary =
169169 [ "Get", "rid", "of", "all", "the"
170170 , D.red (D.fromString tag)
171171 , "stuff", "in"
172− , D.dullyellow (D.fromString (Module.nameToString name))
172+ , D.dullyellow (D.fromString (ModuleName.nameToString name))
173173 , "to", "proceed."
174174 ]
175175 , D.toSimpleNote $
@@ -182,14 +182,14 @@ badTagToDoc path name tag hintName summary =
182182-- NAMELESS
183183
184184
185−namelessToDoc :: FilePath -> Module.Raw -> Help.Report
185+namelessToDoc :: FilePath -> ModuleName.Raw -> Help.Report
186186namelessToDoc path name =
187187 Help.report "UNNAMED MODULE" (Just path)
188− ( "The `" ++ Module.nameToString name
188+ ( "The `" ++ ModuleName.nameToString name
189189 ++ "` module must start with a line like this:"
190190 )
191191 [ D.indent 4 $ D.dullyellow $ D.fromString $
192− "module " ++ Module.nameToString name ++ " exposing (..)"
192+ "module " ++ ModuleName.nameToString name ++ " exposing (..)"
193193 , D.reflow $
194194 "Try adding that as the first line of your file!"
195195 , D.toSimpleNote $
@@ -204,33 +204,33 @@ namelessToDoc path name =
204204-- NOT FOUND
205205
206206
207−notFoundToDoc :: Origin -> Module.Raw -> SrcDirs -> Help.Report
207+notFoundToDoc :: Origin -> ModuleName.Raw -> SrcDirs -> Help.Report
208208notFoundToDoc origin child srcDirs =
209209 case origin of
210210 ElmJson ->
211211 Help.report "MODULE NOT FOUND" (Just "elm.json")
212212 "Your elm.json says your project has the following module:"
213− [ D.indent 4 $ D.red $ D.fromString $ Module.nameToString child
213+ [ D.indent 4 $ D.red $ D.fromString $ ModuleName.nameToString child
214214 , D.reflow $
215215 "When creating packages, all modules must live in the src/ directory."
216216 ]
217217
218218 File path ->
219219 Help.report "UNKNOWN IMPORT" (Just path)
220− ("I cannot find a `" ++ Module.nameToString child ++ "` module to import.")
220+ ("I cannot find a `" ++ ModuleName.nameToString child ++ "` module to import.")
221221 (notFoundDetails child srcDirs)
222222
223223 Module path parent ->
224224 Help.report "UNKNOWN IMPORT" (Just path)
225− ("The " ++ Module.nameToString parent ++ " module has a bad import:")
225+ ("The " ++ ModuleName.nameToString parent ++ " module has a bad import:")
226226 (notFoundDetails child srcDirs)
227227
228228
229−notFoundDetails :: Module.Raw -> SrcDirs -> [D.Doc]
229+notFoundDetails :: ModuleName.Raw -> SrcDirs -> [D.Doc]
230230notFoundDetails child srcDirs =
231231 let
232232 simulatedCode =
233− D.indent 4 $ D.red $ D.fromString $ "import " ++ Module.nameToString child
233+ D.indent 4 $ D.red $ D.fromString $ "import " ++ ModuleName.nameToString child
234234 in
235235 case Map.lookup child Pkg.suggestions of
236236 Just pkg ->
@@ -243,13 +243,13 @@ notFoundDetails child srcDirs =
243243 Pkg ->
244244 D.reflow $
245245 "If you want a local file, make sure the `"
246− ++ Module.nameToString child
246+ ++ ModuleName.nameToString child
247247 ++ "` module is in your src/ directory."
248248
249249 App _ ->
250250 D.reflow $
251251 "If you want a local file, make sure the `"
252− ++ Module.nameToString child
252+ ++ ModuleName.nameToString child
253253 ++ "` module is in one of the \"source-directories\" listed in your elm.json file."
254254 ]
255255
@@ -275,10 +275,10 @@ notFoundDetails child srcDirs =
275275 ]
276276
277277
278−ambiguousToDoc :: Origin -> Module.Raw -> [FilePath] -> [Pkg.Package] -> Help.Report
278+ambiguousToDoc :: Origin -> ModuleName.Raw -> [FilePath] -> [Pkg.Canonical] -> Help.Report
279279ambiguousToDoc origin child paths pkgs =
280280 let
281− pkgToString (Pkg.Package pkg vsn) =
281+ pkgToString (Pkg.Canonical pkg vsn) =
282282 "exposed by " ++ Pkg.toString pkg ++ " " ++ Pkg.versionToString vsn
283283
284284 makeReport maybePath summary yellowString =
@@ -303,22 +303,22 @@ ambiguousToDoc origin child paths pkgs =
303303 makeReport
304304 Nothing
305305 "Your elm.json wants the following module:"
306− (Module.nameToString child)
306+ (ModuleName.nameToString child)
307307
308308 File path ->
309309 makeReport
310310 (Just path)
311311 ("The file at " ++ path ++ " has an ambiguous import:")
312− ("import " ++ Module.nameToString child)
312+ ("import " ++ ModuleName.nameToString child)
313313
314314 Module path parent ->
315315 makeReport
316316 (Just path)
317− ("The " ++ Module.nameToString parent ++ " module has an ambiguous import:")
318− ("import " ++ Module.nameToString child)
317+ ("The " ++ ModuleName.nameToString parent ++ " module has an ambiguous import:")
318+ ("import " ++ ModuleName.nameToString child)
319319
320320
321−kernelNameToDoc :: Origin -> Module.Raw -> Help.Report
321+kernelNameToDoc :: Origin -> ModuleName.Raw -> Help.Report
322322kernelNameToDoc origin kernelName =
323323 let
324324 (maybePath, statement) =
@@ -335,11 +335,11 @@ kernelNameToDoc origin kernelName =
335335
336336 Module path parent ->
337337 ( Just path
338− , "Your " ++ Module.nameToString parent ++ " module is trying to import:"
338+ , "Your " ++ ModuleName.nameToString parent ++ " module is trying to import:"
339339 )
340340 in
341341 Help.report "BAD MODULE NAME" maybePath statement
342− [ D.indent 4 $ D.dullyellow $ D.fromString $ Module.nameToString kernelName
342+ [ D.indent 4 $ D.dullyellow $ D.fromString $ ModuleName.nameToString kernelName
343343 , D.reflow $
344344 "But names like that are reserved for internal use.\
345345 \ Switch to a name outside of the Elm/Kernel/ namespace."
builder/src/Reporting/Exit/Make.hs+3−3
@@ -6,7 +6,7 @@ module Reporting.Exit.Make
66 where
77
88
9−import qualified Elm.Compiler.Module as Module
9+import qualified Elm.ModuleName as ModuleName
1010import qualified Reporting.Doc as D
1111import qualified Reporting.Exit.Help as Help
1212
@@ -17,7 +17,7 @@ import qualified Reporting.Exit.Help as Help
1717
1818data Exit
1919 = CannotMakeNothing
20− | CannotOptimizeDebugValues Module.Raw [Module.Raw]
20+ | CannotOptimizeDebugValues ModuleName.Raw [ModuleName.Raw]
2121 | CannotOptimizeAndDebug
2222
2323
@@ -42,7 +42,7 @@ toReport exit =
4242 CannotOptimizeDebugValues m ms ->
4343 Help.report "DEBUG REMNANTS" Nothing
4444 "There are uses of the `Debug` module in the following modules:"
45− [ D.indent 4 $ D.red $ D.vcat $ map (D.fromString . Module.nameToString) (m:ms)
45+ [ D.indent 4 $ D.red $ D.vcat $ map (D.fromString . ModuleName.nameToString) (m:ms)
4646 , D.reflow "But the --optimize flag only works if all `Debug` functions are removed!"
4747 , D.toSimpleNote $
4848 "The issue is that --optimize strips out info needed by `Debug` functions.\
builder/src/Reporting/Progress.hs+3−3
@@ -14,7 +14,7 @@ module Reporting.Progress
1414
1515import Control.Concurrent.Chan (Chan, writeChan)
1616import Control.Concurrent.MVar (MVar, newEmptyMVar, readMVar)
17−import qualified Elm.Compiler.Module as Module
17+import qualified Elm.ModuleName as ModuleName
1818import Deps.Diff (Magnitude)
1919import Elm.Package (Name, Version)
2020import qualified Reporting.Doc as D
@@ -84,8 +84,8 @@ data Progress
8484
8585 -- compile files
8686 | CompileStart Int
87− | CompileFileStart Module.Raw
88− | CompileFileEnd Module.Raw Outcome
87+ | CompileFileStart ModuleName.Raw
88+ | CompileFileEnd ModuleName.Raw Outcome
8989 | CompileEnd
9090
9191 -- publish
builder/src/Stuff/Paths.hs+6−6
@@ -17,7 +17,7 @@ import qualified System.Directory as Dir
1717import System.FilePath ((</>), (<.>))
1818
1919import qualified Elm.Compiler as Compiler
20−import qualified Elm.Compiler.Module as Module
20+import qualified Elm.ModuleName as ModuleName
2121import qualified Elm.Package as Pkg
2222import qualified Reporting.Task as Task
2323
@@ -64,24 +64,24 @@ removeStuff root =
6464-- ELMI and ELMO
6565
6666
67−elmi :: FilePath -> Module.Raw -> FilePath
67+elmi :: FilePath -> ModuleName.Raw -> FilePath
6868elmi root name =
6969 toArtifactPath root name "elmi"
7070
7171
72−elmo :: FilePath -> Module.Raw -> FilePath
72+elmo :: FilePath -> ModuleName.Raw -> FilePath
7373elmo root name =
7474 toArtifactPath root name "elmo"
7575
7676
77−moduleDocs :: FilePath -> Module.Raw -> FilePath
77+moduleDocs :: FilePath -> ModuleName.Raw -> FilePath
7878moduleDocs root name =
7979 toArtifactPath root name "json"
8080
8181
82−toArtifactPath :: FilePath -> Module.Raw -> String -> FilePath
82+toArtifactPath :: FilePath -> ModuleName.Raw -> String -> FilePath
8383toArtifactPath root name ext =
84− root </> stuff </> Module.nameToHyphenPath name <.> ext
84+ root </> stuff </> ModuleName.nameToHyphenPath name <.> ext
8585
8686
8787
builder/src/Stuff/Verify.hs+3−4
@@ -9,10 +9,9 @@ import Control.Monad (liftM2, liftM4)
99import Data.Binary
1010import Data.Map (Map)
1111
12−import qualified Elm.Compiler.Module as Module
13−import Elm.Package (Name, Version)
14−
1512import qualified Deps.Verify as Verify
13+import qualified Elm.Interface as I
14+import Elm.Package (Name, Version)
1615import qualified Elm.Project.Json as Project
1716import qualified Elm.Project.Constraint as Con
1817import qualified Elm.Project.Summary as Summary
@@ -56,7 +55,7 @@ data MiniSummary =
5655 MiniSummary
5756 { _deps :: ProjectDeps
5857 , _exposed :: Summary.ExposedModules
59− , _ifaces :: Module.Interfaces
58+ , _ifaces :: I.Interfaces
6059 , _depsGraph :: Summary.DepsGraph
6160 }
6261