A Haskell language report describes module export as:
The form “module M” refers to the set of all objects that are in scope, with both the unqualified name “e” and the qualified name “Me”. This set may be empty.
§5.2 Export of lists
The export list identifies the objects that will be exported by the module declaration. A module implementation can only export the object that it declares, or imports it from some other module. If the export list is omitted, all values, types, and classes defined in the module are exported, but not imported.
Entities in the export list can be named as follows:
This means that the semantics are:
module Import ( module Import ) where import Prelude as Import import Yesod as Import -- ...
- take everything that is contained in the Prelude and Yesod modules, and export it.
Instead, you suggest:
module Import where
will not export what is imported by Prelude and Yesod as above:
If the export list is omitted, all values, types and classes defined in the module are exported , but not imported .
source share