简体   繁体   English

Frege中的显式模块导出

[英]Explicit module exports in Frege

I am posting this after reading the Frege language specification and looking for examples using search engines. 我在阅读了Frege语言规范并使用搜索引擎查找示例后发布了这个。 I hope I have not overlooked an obvious answer. 我希望我没有忽视一个明显的答案。

I am trying to port some Haskell code to Frege and I cannot find any documentation mentioning explicit module exports. 我试图将一些Haskell代码移植到Frege,我找不到任何提及显式模块导出的文档。 So, in my Haskell code I have something like 所以,在我的Haskell代码中,我有类似的东西

module common.Timer(start, ...)
where
...

but this will give a compiler error in Frege, and I have to remove the export list: 但这会在Frege中产生编译错误,我必须删除导出列表:

module common.Timer
where
...

But in this way I cannot control which symbols defined in the module get exported. 但是通过这种方式,我无法控制模块中定义的哪些符号被导出。

Is it possible to define explicit module exports in Frege? 是否可以在Frege中定义显式模块导出? If so, what is the syntax? 如果是这样,语法是什么?

Your code looks ok. 你的代码看起来不错。 Before I dive deeper in what is possibly wrong, here is a quick workaround such that you can proceed working: all top-level symbols are exported by default unless it is marked private . 在我深入研究可能出现的问题之前,这里有一个快速的解决方法,您可以继续工作:除非将其标记为private否则默认情况下会导出所有顶级符号。

Edit after discussion: This is a current deviation from that Haskell standard that we are about to resolve. 讨论后编辑:这是我们即将解决的Haskell标准的当前偏差。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM