@@ -260,7 +260,7 @@ parseProject rootPath cacheDir httpTransport verbosity configToParse = do
260
260
let (dir, projectFileName) = splitFileName rootPath
261
261
projectDir <- makeAbsolute dir
262
262
projectPath@ (ProjectConfigPath (canonicalRoot :| _)) <- canonicalizeConfigPath projectDir (ProjectConfigPath $ projectFileName :| [] )
263
- importsBy <- newIORef $ toNubList [( canonicalRoot, projectPath) ]
263
+ importsBy <- newIORef $ toNubList [ProjectImport canonicalRoot projectPath]
264
264
dupesMap <- newIORef mempty
265
265
result <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap projectDir projectPath configToParse
266
266
dupes <- Map. filter ((> 1 ) . length ) <$> readIORef dupesMap
@@ -270,7 +270,7 @@ parseProject rootPath cacheDir httpTransport verbosity configToParse = do
270
270
data Dupes = Dupes
271
271
{ dupesUniqueImport :: FilePath
272
272
, dupesNormLocPath :: ProjectConfigPath
273
- , dupesSeenImportsBy :: [( FilePath , ProjectConfigPath ) ]
273
+ , dupesSeenImportsBy :: [ProjectImport ]
274
274
}
275
275
deriving (Eq )
276
276
@@ -289,7 +289,7 @@ parseProjectSkeleton
289
289
:: FilePath
290
290
-> HttpTransport
291
291
-> Verbosity
292
- -> IORef (NubList ( FilePath , ProjectConfigPath ) )
292
+ -> IORef (NubList ProjectImport )
293
293
-- ^ The imports seen so far, used to report on cycles and duplicates and to detect duplicates that are not cycles
294
294
-> IORef DupesMap
295
295
-- ^ The duplicates seen so far, used to defer reporting on duplicates
@@ -311,7 +311,7 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap project
311
311
-- Once we canonicalize the import path, we can check for cyclical and duplicate imports
312
312
normSource <- canonicalizeConfigPath projectDir source
313
313
normLocPath@ (ProjectConfigPath (uniqueImport :| _)) <- canonicalizeConfigPath projectDir importLocPath
314
- seenImportsBy@ (fmap fst -> seenImports) <- fromNubList <$> atomicModifyIORef' importsBy (\ ibs -> (toNubList [( uniqueImport, normLocPath) ] <> ibs, ibs))
314
+ seenImportsBy@ (fmap importOf -> seenImports) <- fromNubList <$> atomicModifyIORef' importsBy (\ ibs -> (toNubList [ProjectImport uniqueImport normLocPath] <> ibs, ibs))
315
315
debug verbosity $ " \n import path, normalized\n =======================\n " ++ render (docProjectConfigPath normLocPath)
316
316
debug verbosity " \n seen unique paths\n ================="
317
317
mapM_ (debug verbosity) seenImports
0 commit comments