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