6.3.5. Writing qualified in postpositive position¶
Since: 8.10.1 Status: Included in
ImportQualifiedPostallows the syntax
import M qualified, that is, to annotate a module as qualified by writing
qualifiedafter the module name.
To import a qualified module usually you must specify
qualified in prepositive position :
import qualified M. This often leads to a “hanging indent” (which is automatically inserted by some autoformatters and common in many code bases. For example:
import qualified A import B import C
ImportQualifiedPost extension allows
qualified to appear in postpositive position :
import M qualified. With this extension enabled, one can write:
import A qualified import B import C
It is an error if
qualified appears in both pre and postpositive positions.
-Wprepositive-qualified-module (off by default) reports on any occurrences of imports annotated
qualified using prepositive syntax.