Skip to content

Commit

Permalink
Sort import lists
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Apr 22, 2018
1 parent 6b9bf85 commit 2e9ba06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate/src/Write/Module.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ isConstructor = \case

moduleImports :: Module -> [Doc ()]
moduleImports Module {..} =
let unqualifiedImportMap = Map.fromListWith
let unqualifiedImportMap = sort <$> Map.fromListWith
union
((iModule &&& iImports) <$> [i | i@Import{} <- weImports =<< mWriteElements])
qualifiedImportMap = Map.fromListWith
qualifiedImportMap = sort <$> Map.fromListWith
union
((iModule &&& iImports) <$> [i | i@QualifiedImport{} <- weImports =<< mWriteElements])
makeImport :: Doc () -> (Text, [Text]) -> Doc ()
Expand Down Expand Up @@ -178,7 +178,7 @@ moduleInternalImports
-> [Doc ()]
moduleInternalImports nameModule Module {..} =
let deps = simplifyDependencies (weDepends =<< mWriteElements)
depends = Map.fromListWith
depends = sort <$> Map.fromListWith
(<>)
[ ((m, g), [e])
| d <- deps
Expand Down

0 comments on commit 2e9ba06

Please sign in to comment.