Repository navigation
Fix #406 by nubbing module list generated from source files - #408
Conversation
Version 0.34.2 has already been released.
Inserting a `nub` here is strictly improving the state of affairs, since cabal chokes on a module list with duplicates. This patch might also fix sol#353.
|
CI failed, but I do not think this is due to my patch: The travis-ci job GHC 8.4.3 crashes when building cabal: Maybe try GHC 8.4.4 instead. |
| then do | ||
| src <- Directory.canonicalizePath (dir </> src_) | ||
| removeSetup src . map toModule <$> getModuleFilesRecursive src | ||
| removeSetup src . nub . map toModule <$> getModuleFilesRecursive src |
There was a problem hiding this comment.
I was considering this as well. I'm not eager to require containers >= 0.6 though. We can add our own inline definition.
There was a problem hiding this comment.
I shouldn't have used nub, I know, it is evil.
Instead, since getModules returns a sorted list, one could have applied uniq in the end which just removes consecutive duplicates.
uniq = map head . groupOr even better, modify sortModules to remove duplicates.
sortModules = map Module . Set.toAscList . Set.fromList . map unModuleIf you dare to derive Ord for Module, then just:
sortModules = Set.toAscList . Set.fromList UPDATE: forget the Set alternative, I see that sort is special (Hpack.Util.sort).
Since the final list of modules is sorted, it is sufficient to throw out consecutive duplicates, in the style of linx command `uniq`.
|
@andreasabel I just released |
Fix #406 by nubbing module list generated from source files
Inserting a
nubhere is strictly improving the state of affairs, since cabal chokes on a module list with duplicates.This patch might also fix #353.