Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何让Emacs haskell模式在其他hs源目录中查找模块?_Macos_Haskell_Emacs_Haskell Mode - Fatal编程技术网

Macos 如何让Emacs haskell模式在其他hs源目录中查找模块?

Macos 如何让Emacs haskell模式在其他hs源目录中查找模块?,macos,haskell,emacs,haskell-mode,Macos,Haskell,Emacs,Haskell Mode,更新:澄清这是在Mac OS X上 我正在Mac OS X上使用Emacs Prelude(它使用haskell模式),我创建了一个带有stack new hello的项目 它生成的项目如下所示: 您好: 许可证 Setup.hs 你好,阴谋集团 斯塔克阴谋集团 应用程序: Main.hs src: Lib.hs 测试: 规格hs 如果我在Emacs中打开Main.hs,它会显示以下内容: module Main where import Lib main :: IO (

更新:澄清这是在Mac OS X上

我正在Mac OS X上使用Emacs Prelude(它使用haskell模式),我创建了一个带有
stack new hello
的项目

它生成的项目如下所示:

  • 您好:
    • 许可证
    • Setup.hs
    • 你好,阴谋集团
    • 斯塔克阴谋集团
    • 应用程序:
      • Main.hs
    • src:
      • Lib.hs
    • 测试:
      • 规格hs
如果我在Emacs中打开Main.hs,它会显示以下内容:

module Main where

import Lib

main :: IO ()
main = someFunc
Could not find module 'Lib'
Use -v to see a list of the files searched for.
但是Lib被下划线为错误,将插入符号放在此处显示:

module Main where

import Lib

main :: IO ()
main = someFunc
Could not find module 'Lib'
Use -v to see a list of the files searched for.

如何让Emacs haskell模式在其他hs源代码目录中查找模块?

最可怕的是,我通过重新启动修复了这个问题

我似乎是通过破坏堆栈的路径触发的。路径从最初的手动安装更改为
~/Applications/bin/stack
~/.local/bin/stack
。我知道情况发生了变化,所以我关闭并重新启动了Emacs,但问题依然存在


重新启动修复了它。这让我感到悲伤。我想注销可能也能起到同样的作用。

是否将
C-C-l
加载到REPL中?
'haskell-process-type
是否设置为
auto
?顺便问一下:也许您应该更新到当前的
haskell模式
-不确定何时包含
堆栈
-支持,但可能您得到了较旧的版本-另外:为什么有
堆栈.阴谋集团
?这是
stack.yaml
对吗?它可能只是您的路径变量^^^,因此重新启动emacs(真正重新启动)和/或您使用的shell可能也很好(请检查
哪个堆栈
);)@卡斯滕,我从零开始复制它。M-x getenv entpath立即显示了丢失的路径。这是可以通过注销解决的。运行交互式shell需要在.emacs
中单独修复(setq exec path(append exec path'(“/usr/local/bin”))
这很奇怪,因为emacs应该使用您现有的路径(可能顺序错误-将
哪个堆栈指向正确的堆栈)-无论如何,最重要的是它再次为您工作;)@卡斯滕:是的。它现在是实心的。我在这里部分地把事情混为一谈,因为setq步骤与我现在使用bitemyapp的.emacs和.emacs.d/from这一事实有关。