hsimport-0.10.0: Extend the import list of a Haskell source file

Safe HaskellNone
LanguageHaskell2010

HsImport.ImportPos

Synopsis

Documentation

findImportPos :: ImportDecl -> [ImportDecl] -> Maybe ImportPos Source #

Returns the position where the import declaration for the new import should be put into the list of import declarations.

data ImportPos Source #

Where a new import declaration should be added.

Constructors

Before ImportDecl

before the specified import declaration

After ImportDecl

after the specified import declaration

Instances
Eq ImportPos Source # 
Instance details

Defined in HsImport.ImportPos

Show ImportPos Source # 
Instance details

Defined in HsImport.ImportPos

matchingImports :: ModuleName -> [ImportDecl] -> [ImportDecl] Source #

Returns all import declarations having the same module name.

bestMatchingImport :: ModuleName -> [ImportDecl] -> Maybe ImportDecl Source #

Returns the best matching import declaration for the given module name. E.g. if the module name is Foo.Bar.Boo, then Foo.Bar is considered better matching than Foo.