模块A导入Data.Char
模块B-进口模块A
所以模块B会自动导入Data.Char?
如果没有,我需要在模块A中显式导入Data.Char吗?
在我的程序中,模块B不能从Data.Char访问类型
发布于 2014-04-23 14:40:50
您可以从模块Data.Char导出A。
module A (
-- ... other functions
module Data.Char
-- ... other functions
) where
import Data.Char现在,当您使用import A时,Data.Char将可用。
发布于 2014-04-23 14:39:42
如果要从模块B中的Data.Char访问函数和类型,则需要在其中导入Data.Char,除非您导入的模块A已经重新导出了模块B中所需的函数和/或类型。
模块A中Data.Char的导入仅用于该模块本身。
https://stackoverflow.com/questions/23247578
复制相似问题