我有一个像这样的模块
module A where
import qualified Data.Maybe as Maybe
fromMaybe = Maybe.fromMaybe
是否可以仅从Data.Maybe
中重新导出某些功能?我不想重新导出整个Data.Maybe
模块,而只是重新导出某些功能,例如fromMaybe
。
答案 0 :(得分:6)
是的,您可以有选择地重新导出功能:
module A (
module A,
Maybe.fromMaybe ) where
import qualified Data.Maybe as Maybe
模块定义后()
中的片段定义了要导出的内容。这里我们说“将所有module A
连同函数Maybe.fromMaybe
一起导出。”