@@ -61,7 +61,7 @@ generate
6161 -> Crawl.Result
6262 -> Map.Map Module.Raw Compiler.Artifacts
6363 -> Task.Task ()
64−generate mode target maybeOutput summary graph@(Crawl.Graph args _ _ _ _) artifacts =
64+generate mode target maybeOutput summary graph@(Crawl.Graph args locals _ _ _) artifacts =
6565 case args of
6666 Args.Pkg _ ->
6767 return ()
@@ -72,7 +72,8 @@ generate mode target maybeOutput summary graph@(Crawl.Graph args _ _ _ _) artifa
7272 realMode <-
7373 case mode of
7474 Debug ->
75− return $ Mode.debug target (getInterfaces summary artifacts)
75+ do interfaces <- getInterfaces summary locals artifacts
76+ return $ Mode.debug target interfaces
7677
7778 Dev ->
7879 return $ Mode.dev target
@@ -84,14 +85,29 @@ generate mode target maybeOutput summary graph@(Crawl.Graph args _ _ _ _) artifa
8485 generateMonolith realMode maybeOutput summary objectGraph (name:names)
8586
8687
87−getInterfaces :: Summary.Summary -> Map.Map Module.Raw Compiler.Artifacts -> I.Interfaces
88−getInterfaces (Summary.Summary _ project _ interfaces _) artifacts =
88+getInterfaces
89+ :: Summary.Summary
90+ -> Map.Map Module.Raw a
91+ -> Map.Map Module.Raw Compiler.Artifacts
92+ -> Task.Task I.Interfaces
93+getInterfaces (Summary.Summary root project _ interfaces _) locals artifacts =
8994 let
90− pkg = Project.getName project
95+ pkg =
96+ Project.getName project
97+
9198 addArtifact home (Compiler.Artifacts elmi _ _) ifaces =
92− Map.insert (ModuleName.Canonical pkg home) elmi ifaces
99+ (ModuleName.Canonical pkg home, elmi) : ifaces
100+
101+ addInterface home iface ifaces =
102+ (ModuleName.Canonical pkg home, iface) : ifaces
103+
104+ readInterface home _ =
105+ IO.readBinary (Paths.elmi root home)
93106 in
94− Map.foldrWithKey addArtifact interfaces artifacts
107+ do cached <- Map.traverseWithKey readInterface (Map.difference locals artifacts)
108+ return $
109+ Map.union interfaces $ Map.fromList $
110+ Map.foldrWithKey addInterface (Map.foldrWithKey addArtifact [] artifacts) cached
95111
96112
97113