No explicit import list [GHC-77037]

Flag: -Wmissing-import-lists
Enabled by:

If an import statement brings identifiers into scope, but those identifiers are not explicitly listed, then they might become ambiguous in the future.

Examples

Importing Data.Maybe (Maybe(..))

In the example, the import statement brings all the constructors of the Maybe data type into scope, without mentioning them explicitly. The warning can be fixed by explicitly importing the constructors of the Maybe data type.

Warning Message

example1/before/Example.hs:4:1: warning: [-Wmissing-import-lists] [GHC-77037]
    The import item ‘Maybe(..)’ does not have an explicit import list
  |
4 | import Data.Maybe (Maybe(..))
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Example.hs
Before
{-# OPTIONS_GHC -Wmissing-import-lists #-}
module Example where

import Data.Maybe (Maybe(..))
After
{-# OPTIONS_GHC -Wmissing-import-lists #-}
module Example where

import Data.Maybe (Maybe(Just, Nothing))