agda - Loading files in Agda: unclear explanation in Learn you an Agda
问题描述
I have made an emacs file trial_agda.agda
with the following code:
module trial_agda where
data : Set where
zero :
suc : →
data _even : → Set where
ZERO : zero even
STEP : ∀ x → x even → suc (suc x) even
_+_ : → →
(zero + n) = n
(suc n) + n′ = suc (n + n′)
In http://learnyouanagda.liamoc.net/pages/proofs.html, the author writes:
Now we’ll prove in Agda that four is even. Type the following into an emacs buffer, and type C-c C-l:
-- \_1 to type ₁
proof₁ : suc (suc (suc (suc zero))) even
proof₁ = ?
I typed C-c C-n
and then copied and pasted the above code. I received the error Error: First load the file.
What has gone wrong?
解决方案
需要将代码添加到同一个 emacs 文件中,在定义模块和类型等的代码下方。
这在书中没有具体说明。
推荐阅读
- c# - 无法使用 c# 客户端连接 docker aerospike 服务器
- android - 如何从资产 android (API 21+) 播放 swf 文件?
- c - 使用指针类型转换时值发生莫名其妙的变化
- javascript - 如果反应组件中的 Else 总是运行 else 条件
- python - 蛇游戏:蛇与自己相撞
- python - 如何将张量逐行乘以 PyTorch 中的向量?
- c# - 更改其 onchange 侦听器内文本框的边框颜色
- python-3.x - 当我使用扩展时列表返回 0(多处理池)
- c - 将值插入最大二进制堆时出现问题
- class - Haskell 无法将预期类型 'Item Nat' 与实际类型 '()' 匹配