diff --git a/message-index/messages/GHC-90973/exportedModNotImported/after/ExportedModNotImported.hs b/message-index/messages/GHC-90973/exportedModNotImported/after/ExportedModNotImported.hs new file mode 100644 index 00000000..f18db0d7 --- /dev/null +++ b/message-index/messages/GHC-90973/exportedModNotImported/after/ExportedModNotImported.hs @@ -0,0 +1,3 @@ +module ExportedModNotImported (module Data.List) where + +import Data.List diff --git a/message-index/messages/GHC-90973/exportedModNotImported/before/ExportedModNotImported.hs b/message-index/messages/GHC-90973/exportedModNotImported/before/ExportedModNotImported.hs new file mode 100644 index 00000000..b8cfd83d --- /dev/null +++ b/message-index/messages/GHC-90973/exportedModNotImported/before/ExportedModNotImported.hs @@ -0,0 +1 @@ +module ExportedModNotImported (module Data.List) where diff --git a/message-index/messages/GHC-90973/exportedModNotImported/index.md b/message-index/messages/GHC-90973/exportedModNotImported/index.md new file mode 100644 index 00000000..97d82ca6 --- /dev/null +++ b/message-index/messages/GHC-90973/exportedModNotImported/index.md @@ -0,0 +1,14 @@ +--- +title: Exporting module which has not been imported +--- + +```haskell +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. diff --git a/message-index/messages/GHC-90973/index.md b/message-index/messages/GHC-90973/index.md new file mode 100644 index 00000000..0762b9f3 --- /dev/null +++ b/message-index/messages/GHC-90973/index.md @@ -0,0 +1,25 @@ +--- +title: Exported module not imported +summary: Export list contains a module that is not imported +severity: error +introduced: 9.6.1 +--- + +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](https://www.haskell.org/onlinereport/modules.html) 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: + +```haskell +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 ` export from the export list