Haskell重新脱离模块,该模块仅导入标识符的选定部分

发布于 2025-02-06 01:19:21 字数 713 浏览 0 评论 0原文

我知道我可以重新启动模块,例如以下内容:

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

参考:

I know that I can re-export modules like following:

module Test (module Test) where

import Prelude as Test
import A as Test

f x = x

But now I want to do re-export a partial imported module like

module Test (module Test) where

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

f x = x

References:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最偏执的依靠 2025-02-13 01:19:22

来自 haskell wiki关于导入,有一个这样的示例:

import Mod as Foo (x,y)

因此,这样做:这样:

module Test (module Test) where

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

f x = x

From Haskell wiki about Import, there is an example like this:

import Mod as Foo (x,y)

So, do it like this:

module Test (module Test) where

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

f x = x
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文