程序编译时 Idris REPL 找不到导入
Idris REPL can't find import while the program compiles
我克隆了 this Idris library 并且它在必要的依赖项下编译得很好。有一个 example/
目录,它利用库(导入它的一些模块),它编译并且 运行 也很好。但是,当我尝试 运行 Atom 中的 REPL 时,会显示一条熟悉的错误消息:
Can't find import Graphics/Util/GlfwConfig
这很有趣,因为当执行 make
时,以下是输出行之一:
Installing Graphics/Util/Glfw.ibc to /home/jan/.stack/snapshots/x86_64-linux-tinfo6/lts-11.17/8.2.2/share/x86_64-linux-ghc-8.2.2/idris-1.3.0/libs/glfw/Graphics/Util
这似乎表明该模块已安装。
我可能误解了 Haskell/Idris/Stack 在此处安装和 Idris 模块的过程的某些部分,那么我应该在此处 do/understand 做什么?
当使用 stack
时,REPL 必须通过堆栈启动:stack ghci
而不仅仅是 ghci
。这将编译并加载库中的模块。
我不熟悉 Atom,但根据 this,REPL 会尝试猜测 运行 的正确 ghci
命令。它得到了错误的命令,而不是 运行ning stack ghci
.
我想问题很简单,因为项目包含两个 ipkg
文件。一份给图书馆,一份给 test/example。
example/hello
中的那个:
package test
opts = "-p effects -p glfw "
executable = hello
main = Main
包括对 idris 包 glfw 的依赖,但如果您在顶级目录中调用 Atom,则 Atom 看不到它。要验证,请切换到目录 example/hello
并调用 atom .
并从那里尝试。现在 ipkg 文件在顶层目录中,将被 Atom 获取。
我克隆了 this Idris library 并且它在必要的依赖项下编译得很好。有一个 example/
目录,它利用库(导入它的一些模块),它编译并且 运行 也很好。但是,当我尝试 运行 Atom 中的 REPL 时,会显示一条熟悉的错误消息:
Can't find import Graphics/Util/GlfwConfig
这很有趣,因为当执行 make
时,以下是输出行之一:
Installing Graphics/Util/Glfw.ibc to /home/jan/.stack/snapshots/x86_64-linux-tinfo6/lts-11.17/8.2.2/share/x86_64-linux-ghc-8.2.2/idris-1.3.0/libs/glfw/Graphics/Util
这似乎表明该模块已安装。
我可能误解了 Haskell/Idris/Stack 在此处安装和 Idris 模块的过程的某些部分,那么我应该在此处 do/understand 做什么?
当使用 stack
时,REPL 必须通过堆栈启动:stack ghci
而不仅仅是 ghci
。这将编译并加载库中的模块。
我不熟悉 Atom,但根据 this,REPL 会尝试猜测 运行 的正确 ghci
命令。它得到了错误的命令,而不是 运行ning stack ghci
.
我想问题很简单,因为项目包含两个 ipkg
文件。一份给图书馆,一份给 test/example。
example/hello
中的那个:
package test
opts = "-p effects -p glfw "
executable = hello
main = Main
包括对 idris 包 glfw 的依赖,但如果您在顶级目录中调用 Atom,则 Atom 看不到它。要验证,请切换到目录 example/hello
并调用 atom .
并从那里尝试。现在 ipkg 文件在顶层目录中,将被 Atom 获取。