Skip to content

Importing Modules

We have already seen that we use

import ModuleName

to import a module into another module. Just as a module header without export list, such as

module ModuleName where

means that everything defined in this module is to be exported, an import without any import list, such as

import ModuleName

means that everything exported from this module is to be imported. Note that I said, "everything exported from this module". So we cannot simply omit the import list to gain access to private definitions in a module; private means private.

Sometimes, however, we do not want to import everything defined in a module but only a few specific types and functions defined in that module. For this purpose, we have import lists.