6 haskell
我在同一个文件夹中有两个文件,Eval.hs而且Data.hs,我在Eval.hs导入模块TI.Data中的模块Data.hs,当我尝试Eval.hs在交互式加载时(在emacs的haskell模式下Ctrl-c, Ctrl l),它说它找不到定义的模块Data.hs,但它在之前成功加载,为什么突然它不能?? 顺便说一句,我注意到我第一次执行时Ctrl-c, Ctrl l,是交互窗口:
GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :cd ~/.cabal/
Prelude> :load "../hs/TI/Eval.hs"
../hs/TI/Eval.hs:2:7:
Could not find module `TI.Data':
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)
我有时在Emacs上使用haskell-mode会遇到同样的问题.我的解决方法是
Prelude> :cd ~/hs/TI
Prelude> :load "Eval.hs"
Run Code Online (Sandbox Code Playgroud)
现在,当您想要重新加载模块时,您必须使用它
Prelude> :r
Run Code Online (Sandbox Code Playgroud)
而不是Ctrl-C,Ctrl-l.
如果有人知道更好的方法,请告诉我.
-deech