hindent-6.0.0: Extensible Haskell pretty printer
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIndent.Pretty.Import

Description

Helper functions for dealing with import declarations.

Synopsis

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.