module-management-0.20.4: Clean up module imports, split and merge modules

Safe HaskellNone
LanguageHaskell98

Language.Haskell.Modules.Common

Synopsis

Documentation

groupBy' :: Ord a => (a -> a -> Ordering) -> [a] -> [[a]] Source

Combine sortBy and groupBy

withCurrentDirectory :: (MonadIO m, MonadBaseControl IO m) => FilePath -> m a -> m a Source

Perform an action with the working directory set to path.

doResult :: (ModuVerse m, MonadDryRun m, MonadVerbosity m) => ModuleResult -> m ModuleResult Source

It is tempting to put import cleaning into these operations, but that needs to be done after all of these operations are completed so that all the compiles required for import cleaning succeed. On the other hand, we might be able to maintain the moduVerse here.

fixExport :: [ModuleName] -> ModuleName -> ModuleName -> ExportSpec l -> String -> String -> String -> Seq String -> Seq String Source

Update an export spec. The only thing we might need to change is re-exports, of the form "module Foo".