- 论坛徽章:
- 0
|
本帖最后由 retuor 于 2010-07-18 16:57 编辑
Stdm 是个模块,实现了一些命题逻辑的运算符,比如 /\ 表示 and, ==> 表示蕴涵.....
现在想在我的代码里使用这个模块,应该如何做呢。我现阶段是在 ghci 交互环境中学习 haskell 的,一般把代码写在一个文件中,比如 3.hs,然后 :load 进来。 书上建议通过 :load Stdm 来使用这个模块,但我自己的代码在 3.hs 中,如果我再 :load 3 的话,Stdm 就消失了。
我看了点 ghci 的 help,好像 :add 可以添加文件,但试用了还是不行。Prelude> :l Stdm
[1 of 1] Compiling Stdm ( Stdm.lhs, interpreted )
Ok, modules loaded: Stdm.
*Stdm> True /\ False
False
*Stdm> :l "6.4/3"
[1 of 1] Compiling Main ( 6.4/3.hs, interpreted )
Ok, modules loaded: Main.
*Main> True /\ False
<interactive>:1:5: Not in scope: `/\' Prelude> :load Stdm
[1 of 1] Compiling Stdm ( Stdm.lhs, interpreted )
Ok, modules loaded: Stdm.
*Stdm> True /\ False
False
*Stdm> :add "6.4/3"
[1 of 2] Compiling Main ( 6.4/3.hs, interpreted )
Ok, modules loaded: Stdm, Main.
*Main> True /\ False
<interactive>:1:5: Not in scope: `/\' 3.hs 目前是空的,而 Stdm 在附件中。谢谢。
Stdm.lhs.gz
(13.36 KB, 下载次数: 65)
|
|