Haskell再导出模块,仅导入标识符的选定部分

guz6ccqo  于 2022-11-14  发布在  其他
关注(0)|答案(1)|浏览(149)

我知道我可以重新导出模块,如下所示:

module Test (module Test) where

import Prelude as Test
import A as Test

f x = x

但现在我想重新导出一个部分导入的模块,如

module Test (module Test) where

import Prelude (map, filter) as Test
import A as Test

f x = x

参考文献:

9gm1akwq

9gm1akwq1#

Haskell wiki about Import,有这样一个例子:

import Mod as Foo (x,y)

所以,这样做:

module Test (module Test) where

import Prelude as Test (map, filter)
import A as Test

f x = x

相关问题