Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Provides functionality to manage imports
Synopsis
- parseImportsFromFile :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [(ModuleName, ImportDeclarationType, Maybe ModuleName)])
- parseImportsFromFile' :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [Text], [Import], [Text])
- parseImport :: Text -> Maybe Import
- prettyPrintImportSection :: [Import] -> [Text]
- sliceImportSection :: [Text] -> Either Text (ModuleName, [Text], [Import], [Text])
- prettyPrintImport' :: Import -> Text
- data Import = Import ModuleName ImportDeclarationType (Maybe ModuleName)
Documentation
parseImportsFromFile :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [(ModuleName, ImportDeclarationType, Maybe ModuleName)]) Source #
Reads a file and returns the parsed module name as well as the parsed imports, while ignoring eventual parse errors that aren't relevant to the import section
parseImportsFromFile' :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [Text], [Import], [Text]) Source #
Reads a file and returns the (lines before the imports, the imports, the lines after the imports)
prettyPrintImportSection :: [Import] -> [Text] Source #
sliceImportSection :: [Text] -> Either Text (ModuleName, [Text], [Import], [Text]) Source #
prettyPrintImport' :: Import -> Text Source #