Exported module not imported [GHC-90973]

An Export List of a Haskell module identifies the entities (functions, types, etc.) to be exported by a module declaration. The syntax for export lists is described in the section 5.2 of the Haskell 98 Language and Libraries report. Apart from exporting individual functions and data types, the specification also allows you to re-export entire modules as in this example:

module My.List.Reexport (module Data.List) where

import Data.List

...

This tells GHC to include all the symbols exported by the module Data.List to also be exported by My.List.Reexport module.

The error message GHC-90973 occurs when module’s export list contains a module export of a module, which hasn’t been imported.

The usual way to fix it is to either: 1. add the missing module import 2. remove the module <MISSING-MODULE> export from the export list

Examples

Exporting module which has not been imported
ExportedModNotImported.hs:1:32: error:
    The export item ‘module Data.List’ is not imported
  |
1 | module ExportedModNotImported (module Data.List) where
  |

We’re trying to reexport a module which has not been imported. In this case we fix it by adding the missing import statement.

ExportedModNotImported.hs
Before
module ExportedModNotImported (module Data.List) where
After
module ExportedModNotImported (module Data.List) where

import Data.List