Safe Haskell | None |
---|
Functions to control the state variables of MonadClean
.
- class (MonadIO m, MonadCatchIO m, Functor m) => MonadClean m
- runMonadClean :: MonadCatchIO m => StateT Params m a -> m a
- modifyModuVerse :: MonadClean m => (Set ModuleName -> Set ModuleName) -> m ()
- modifyRemoveEmptyImports :: MonadClean m => (Bool -> Bool) -> m ()
- modifySourceDirs :: MonadClean m => ([FilePath] -> [FilePath]) -> m ()
- modifyExtensions :: MonadClean m => ([Extension] -> [Extension]) -> m ()
- modifyHsFlags :: MonadClean m => ([String] -> [String]) -> m ()
- modifyDryRun :: MonadClean m => (Bool -> Bool) -> m ()
- modifyTestMode :: MonadClean m => (Bool -> Bool) -> m ()
Documentation
class (MonadIO m, MonadCatchIO m, Functor m) => MonadClean m Source
runMonadClean :: MonadCatchIO m => StateT Params m a -> m aSource
Create the environment required to do import cleaning and module splitting/merging. This environment, StateT Params m a, is an instance of MonadClean.
modifyModuVerse :: MonadClean m => (Set ModuleName -> Set ModuleName) -> m ()Source
Modify the set of modules whose imports will be updated when modules are split or merged. No default, it is an error to run splitModules or catModules without first setting this.
modifyRemoveEmptyImports :: MonadClean m => (Bool -> Bool) -> m ()Source
If this flag is set, imports that become empty are removed.
Sometimes this will lead to errors, specifically when an instance
in the removed import that was required is no longer be available.
(Note that this reflects a limitation of the
-ddump-minimal-imports
option of GHC.) If this happens this flag
should be set. Note that an import that is already empty when
cleanImports
runs will never be removed, on the assumption that
it was placed there only to import instances. Default is True.
modifySourceDirs :: MonadClean m => ([FilePath] -> [FilePath]) -> m ()Source
Modify the list of directories that will be searched for source
files, in a similar way to the Hs-Source-Dirs field in a cabal
file. Default is ["."]
.
modifyExtensions :: MonadClean m => ([Extension] -> [Extension]) -> m ()Source
Modify the extra extensions passed to the compiler and the
parser. Default value is the list in
defaultParseMode
.
modifyHsFlags :: MonadClean m => ([String] -> [String]) -> m ()Source
Modify the list of extra flags passed to GHC. Default is []
.
modifyDryRun :: MonadClean m => (Bool -> Bool) -> m ()Source
Controls whether file updates will actually be performed. Default is False. (I recommend running in a directory controlled by a version control system so you don't have to worry about this.)
modifyTestMode :: MonadClean m => (Bool -> Bool) -> m ()Source
If TestMode is turned on no import cleaning will occur after a split or cat. Default is False.