@@ -61,7 +61,7 @@ generate
61 -> Crawl.Result
61 -> Crawl.Result
62 -> Map.Map Module.Raw Compiler.Artifacts
62 -> Map.Map Module.Raw Compiler.Artifacts
63 -> Task.Task ()
63 -> 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 =
65 case args of
65 case args of
66 Args.Pkg _ ->
66 Args.Pkg _ ->
@@ -72,7 +72,8 @@ generate mode target maybeOutput summary graph@(Crawl.Graph args _ _ _ _) artifa
72 realMode <-
72 realMode <-
73 case mode of
73 case mode of
75+ do interfaces <- getInterfaces summary locals artifacts
75− return $ Mode.debug target (getInterfaces summary artifacts)
76+ return $ Mode.debug target interfaces
78 return $ Mode.dev target
79 return $ Mode.dev target
@@ -84,14 +85,29 @@ generate mode target maybeOutput summary graph@(Crawl.Graph args _ _ _ _) artifa
84 generateMonolith realMode maybeOutput summary objectGraph (name:names)
85 generateMonolith realMode maybeOutput summary objectGraph (name:names)
90+ -> Map.Map Module.Raw a
87−getInterfaces :: Summary.Summary -> Map.Map Module.Raw Compiler.Artifacts -> I.Interfaces
91+ -> Map.Map Module.Raw Compiler.Artifacts
92+ -> Task.Task I.Interfaces
88−getInterfaces (Summary.Summary _ project _ interfaces _) artifacts =
93+getInterfaces (Summary.Summary root project _ interfaces _) locals artifacts =
90− pkg = Project.getName project
96+ Project.getName project
91 addArtifact home (Compiler.Artifacts elmi _ _) ifaces =
98 addArtifact home (Compiler.Artifacts elmi _ _) ifaces =
99+ (ModuleName.Canonical pkg home, elmi) : ifaces
101+ addInterface home iface ifaces =
92− Map.insert (ModuleName.Canonical pkg home) elmi ifaces
102+ (ModuleName.Canonical pkg home, iface) : ifaces
104+ readInterface home _ =
105+ IO.readBinary (Paths.elmi root home)
107+ do cached <- Map.traverseWithKey readInterface (Map.difference locals artifacts)
109+ Map.union interfaces $ Map.fromList $
94− Map.foldrWithKey addArtifact interfaces artifacts
110+ Map.foldrWithKey addInterface (Map.foldrWithKey addArtifact [] artifacts) cached