Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Helper functions for dealing with import declarations.
Synopsis
- importsExist :: HsModule -> Bool
- extractImports :: HsModule -> [[LImportDecl GhcPs]]
- extractImportsSorted :: HsModule -> [[LImportDecl GhcPs]]
- groupImports :: [LImportDecl GhcPs] -> [[LImportDecl GhcPs]]
Documentation
importsExist :: HsModule -> Bool Source #
Returns if the module has import declarations.
extractImports :: HsModule -> [[LImportDecl GhcPs]] Source #
Extracts import declarations from the given module. Adjacent import declarations are grouped as a single list.
extractImportsSorted :: HsModule -> [[LImportDecl GhcPs]] Source #
Extracts import declarations from the given module and sorts them by their names. Adjacent import declarations are grouped as a single list.
groupImports :: [LImportDecl GhcPs] -> [[LImportDecl GhcPs]] Source #
Combines adjacent import declarations into a single list.