winGHCi 错误不在范围内
我刚刚开始使用 Haskell 平台进行 Haskell 编程。我正在运行 winGHCi 1.0.6。
我使用以下代码创建了一个“basic.hs”文件: square x = x * x
我在 Haskell Platform 下创建了一个文件夹,并将“basic.hs”保存在那里。然后,当我加载“basic.hs”文件时,我收到以下消息:
*ghci> :cd C:\Program Files\Haskell Platform\2011.4.0.0\winghci
Warning: changing directory causes all loaded modules to be unloaded,
because the search path has changed.
ghci> :load "basic.hs"
[1 of 1] Compiling Main ( basic.hs, interpreted )
Ok, modules loaded: Main.*
然后我尝试使用我定义的函数“square”,但出现以下错误:
*ghci> square 3
<interactive>:1:1: Not in scope: `square*
任何帮助将不胜感激。
伊索姆
I have just started programming Haskell using Haskell Platform. I'm running winGHCi 1.0.6.
I created a "basic.hs" file with the following code: square x = x * x
I create a folder under Haskell Platform and saved the "basic.hs" there. Then when I loaded the "basic.hs" file I got the following message:
*ghci> :cd C:\Program Files\Haskell Platform\2011.4.0.0\winghci
Warning: changing directory causes all loaded modules to be unloaded,
because the search path has changed.
ghci> :load "basic.hs"
[1 of 1] Compiling Main ( basic.hs, interpreted )
Ok, modules loaded: Main.*
Then I try to use the function "square" I defined and I get the following error:
*ghci> square 3
<interactive>:1:1: Not in scope: `square*
Any help would be appreciated.
Isom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论