@@ -8,6 +8,7 @@ module Build
88 , Module(..)
99 , CachedInterface(..)
1010 , DocsGoal(..)
11+ , getMainNames
1112 )
1213 where
1314
@@ -185,6 +186,22 @@ fromMains style root details paths =
185186
186187
187188
189+-- GET MAIN NAMES
190+
191+
192+getMainNames :: Artifacts -> NE.List ModuleName.Raw
193+getMainNames (Artifacts _ _ mains _) =
194+ fmap getMainName mains
195+
196+
197+getMainName :: Main -> ModuleName.Raw
198+getMainName main =
199+ case main of
200+ Inside name -> name
201+ Outside name _ _ -> name
202+
203+
204+
188205-- CRAWL
189206
190207
@@ -878,7 +895,7 @@ isInsideSrcDirs (Env _ root _ srcDirs _ _) path absolutePath =
878895 case (exits, Maybe.catMaybes maybes) of
879896 (_, [(_,name)]) -> Right (Location absolutePath path (LInside name))
880897 ([], []) -> Right (Location absolutePath path (LOutside path))
881− (_, (s1,_):(s2,_):_) -> Left (Exit.BP_WithAmbiguousSrcDir s1 s2)
898+ (_, (s1,_):(s2,_):_) -> Left (Exit.BP_WithAmbiguousSrcDir path s1 s2)
882899 (exit:_, _) -> Left exit
883900
884901