Safe Haskell | None |
---|---|
Language | Haskell2010 |
Importify.Syntax.Import
Description
Haskell AST utilities to work with import
section.
- getImportModuleName :: ImportDecl l -> ModuleName ()
- importNamesWithTables :: [InScoped ImportDecl] -> [(ModuleName (), Table)]
- importSlice :: [ImportDecl SrcSpanInfo] -> Maybe (Int, Int)
- isImportImplicit :: ImportDecl l -> Bool
- switchHidingImports :: Module SrcSpanInfo -> Module SrcSpanInfo
Documentation
getImportModuleName :: ImportDecl l -> ModuleName () Source #
Returns module name for ImportDecl
with annotation erased.
importNamesWithTables :: [InScoped ImportDecl] -> [(ModuleName (), Table)] Source #
Collect mapping from import name to to list of symbols it exports.
importSlice :: [ImportDecl SrcSpanInfo] -> Maybe (Int, Int) Source #
Returns pair of line numbers — first and last line of import section if any import is in list.
isImportImplicit :: ImportDecl l -> Bool Source #
Returns True
iff import has next form:
import Module.Name
import Module.Name as Other.Name
import Module.Name hiding (smth)
switchHidingImports :: Module SrcSpanInfo -> Module SrcSpanInfo Source #
Keep only hiding imports making them non-hiding. This function
needed to collect unused hiding imports because importTable
doesn't
track information about hiding imports.