如何从我的.xmonad / xmonad.hs导入本地模块

sha*_*ahn 2 haskell xmonad

我正在尝试从〜/ .xmonad / Tree.hs导入一个名为'Tree.hs'的自定义本地模块,但是我得到了:

Error detected while loading xmonad configuration file: /home/shahn/.xmonad/xmonad.hs

xmonad.hs:55:8:
    Could not find module ‘Tree’
    Use -v to see a list of the files searched for.

Please check the file for errors.
Run Code Online (Sandbox Code Playgroud)

ghc似乎没有在〜/ .xmonad中搜索模块。是否有实现此目标的好方法?

zud*_*dov 5

Xmonad在~/.xmonad/lib目录中搜索模块。只需将您的模块放在那里。

http://xmonad.org/manpage.html#modular-configuration