Agda:无法执行 IO - 缺少 Data.FFI、IO.FFI

Agda: Unable to do IO - missing Data.FFI, IO.FFI

作为业余爱好,我已经在 agda 中做了几个月的事情,并且我开始制作一个可证明的 safe\correct 井字游戏。 我已经得到了所有的引理证明和定义,但是现在我已经尝试获取输入和打印输出,我 运行 遇到了问题。 从网络上获取的所有 "Hello World" 个例子都失败了,其中大部分都带有我缺少 Data.FFI 和 IO.FFI 的消息。 我在网上四处寻找解决方案,但 none 有用。一个网站说我应该从 agda/agda-stdlib-0.11/ffi 运行 "cabal install" 但我 "m not even sure if I have that folder on my computer, and I have many folders named "agda" 在整个计算机上(这是我第一次使用 linux为了某事,所以我可能做的事情很糟糕) 这是我在尝试使用 agda-mode (C-c C-x C-c)运行 来自 EMACS 的代码时遇到的错误

Compilation error:

MAlonzo/Code/Agda/Primitive.hs:4:18:
    Could not find module ‘Data.FFI’
    Use -v to see a list of the files searched for.

MAlonzo/Code/Agda/Primitive.hs:5:18:
    Could not find module ‘IO.FFI’
    Use -v to see a list of the files searched for.

如果重要的话,我 运行宁 Ubuntu。 非常感谢您的帮助!

One website said I should run "cabal install" from agda/agda-stdlib-0.11/ffi

没错。来自标准库的 README 0.11:

-- To compile the library using the MAlonzo compiler you first need to
-- install some supporting Haskell code, for instance as follows:
--
--   cd ffi
--   cabal install