我有两个名为.hs文件:一个包含新型减速,而另一个使用它不在范围内的数据构造
first.hs:
module first() where
type S = SetType
data SetType = S[Integer]
second.hs:
module second() where
import first
当我运行second.hs时,两个模块第一个,第二个都加载得很好 但是,当我在Haskell平台上编写:type
S时,出现以下错误
Not in scope : data constructor 'S'
注:有每个模块可以肯定在某些功能,我只是跳过它 的问题作出澄清
是的,它颗星的大写字母(我只是忘了在这里写这种方式) 哪里写导入行呢? – Shimaa
是的,否则不会编译。 –
哪里写导入第一行,这样它的数据类型在Second的范围内? – Shimaa