0
我似乎无法直接执行ghci
当导入一个模块,但是我能够执行ghci xmonad.hs
时加载模块。如何导入GHCi路径中的模块?
目录树:
.
├── ghcid.sh
├── lib
│ ├── FocusWindow.hs
│ ├── MiddleColumn.hs
│ ├── Readme.md
│ └── TAGS
├── Readme.md
├── TAGS
├── xmonad2.hs
├── xmonad.errors
├── xmonad.hs
├── xmonad.state
├── xmonad.state.backup
└── xmonad-x86_64-linux
.ghci
:set -Wall
:set -i:lib
ghci的提示:
Prelude> :show paths
current working directory:
/home/chris/.xmonad
module import search paths:
.
lib
Display all 2040 possibilities? (y or n)
Prelude> import FocusWindow
<no location info>: error:
Could not find module ‘FocusWindow’
It is not a module in the current program, or in any known package.
ghci的xmonad.hs提示
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/chris/.xmonad/.ghci
[1 of 3] Compiling FocusWindow (lib/FocusWindow.hs, interpreted)
[2 of 3] Compiling MiddleColumn (lib/MiddleColumn.hs, interpreted)
[3 of 3] Compiling Main (xmonad.hs, interpreted)
Ok, modules loaded: MiddleColumn, FocusWindow, Main.
*Main> import FocusWindow
*Main FocusWindow> :show paths
current working directory:
/home/chris/.xmonad
module import search paths:
.
lib
你试过'? –
工作,谢谢。我仍然想知道为什么。 –