coq - 类型方案的提取

标签 coq coq-extraction

我正在尝试提取一些我用 Coq 编写的文件系统代码。我想用 Haskell 的 IO Monad 替换我的 FileIO Monad。我的代码如下所示:

Variable FileIO : Type -> Type.
Variable sync : FileIO unit.

Extract Inlined Constant sync => "synchronize".
Extract Inlined Constant FileIO => "IO".

Recursive Extraction append.

替换 sync 没问题,但是当我尝试用 IO 替换 FileIO 时,出现以下错误:

Error: The type scheme axiom  FileIO needs 1 type variable(s).

这个错误是什么意思,我该如何解决?

最佳答案

这可能是一个限制。您需要为 FileIO 提供一个参数,并且不允许内联它。

Extract Constant FileIO "x" => "IO x".

关于coq - 类型方案的提取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28144162/

相关文章:

coq - 帮助子序列的 Coq 证明

coq - Coq 命令 Require Import Ltac 有什么作用?

coq - 感应型 X 消去错误 "or":

recursion - Coq新手: How to iterate trough binary-tree in Coq

Coq证明用法

coq - 是否可以使用 Coq 编写 C 程序?

ocaml - Ocaml 库中的 string_dec 和字符串

coq - 如何在 Coq 中精确执行一次计算?

coq - `omega` 在这里到底做了什么?