Skip to content

Commit e26b665

Browse files
authored
Document GHC-90973 (#496)
1 parent ab5eeda commit e26b665

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module ExportedModNotImported (module Data.List) where
2+
3+
import Data.List
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module ExportedModNotImported (module Data.List) where
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Exporting module which has not been imported
3+
---
4+
5+
```haskell
6+
ExportedModNotImported.hs:1:32: error:
7+
The export item module Data.List is not imported
8+
|
9+
1 | module ExportedModNotImported (module Data.List) where
10+
|
11+
```
12+
13+
We're trying to reexport a module which has not been imported.
14+
In this case we fix it by adding the missing import statement.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Exported module not imported
3+
summary: Export list contains a module that is not imported
4+
severity: error
5+
introduced: 9.6.1
6+
---
7+
8+
An *Export List* of a Haskell module identifies the entities (functions, types, etc.) to be exported by a module declaration.
9+
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:
10+
11+
```haskell
12+
module My.List.Reexport (module Data.List) where
13+
14+
import Data.List
15+
16+
...
17+
```
18+
19+
This tells GHC to include all the symbols exported by the module `Data.List` to also be exported by `My.List.Reexport` module.
20+
21+
The error message `GHC-90973` occurs when module's export list contains a module export of a module, which hasn't been imported.
22+
23+
The usual way to fix it is to either:
24+
1. add the missing module import
25+
2. remove the `module <MISSING-MODULE>` export from the export list

0 commit comments

Comments
 (0)