How to implicitly import a module

Module A import Data.Char

Module B imports module A

So, module B automatically imports Data.Char?

If I do not need to explicitly import Data.Char into module A?

In my program, module B cannot access types from Data.Char

+4
source share
2 answers

You can export Data.Charfrom the module A.

module A (
    -- ... other functions
    module Data.Char
    -- ... other functions
) where

import Data.Char

Now that you have import A, Data.Charwill be available.

+14
source

If you want to access functions and types from Data.Charwithin your module B, you need to import into it Data.Char, unless module A that you already imported did not export the functions and / or types that you need to module B.

Data.Char A .

0

Source: https://habr.com/ru/post/1537728/


All Articles