We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e2e060 commit 6744f1aCopy full SHA for 6744f1a
Cabal-syntax/src/Distribution/Compat/Graph.hs
@@ -380,15 +380,17 @@ fromMap m =
380
381
-- | /O(V log V)/. Convert a list of nodes (with distinct keys) into a graph.
382
fromDistinctList :: (HasCallStack, IsNode a, Show (Key a)) => [a] -> Graph a
383
-fromDistinctList =
+fromDistinctList xs =
384
fromMap
385
. Map.fromListWith (\_ -> duplicateError)
386
- . map (\n -> n `seq` (nodeKey n, n))
+ . map (\n -> n `seq` (nodeKey n, n)) $ xs
387
where
388
duplicateError n =
389
error $
390
"Graph.fromDistinctList: duplicate key: "
391
++ show (nodeKey n)
392
+ ++ " in "
393
+ ++ unlines (map (show . nodeKey) xs)
394
395
-- Map-like operations
396
0 commit comments