3
假设我有一个record
,其中包含两个nats
。从Coq定义中返回记录
Record toy := {
num1 : nat;
num2 : nat
}.
我想建立一个给出了两个nats
返回包含这两个nats
一个record
的定义。
Definition args_to_toy_record (n1 : nat) (n2 : nat) : toy :=
(* {num1 = n1; num2 = n2} ?? *)
不幸的是,官方文档似乎只涉及简单的情况下,当返回类型是bool
或nat
。在coq
中是否有这种可能?如果是的话,实现它的最好方法是什么?
谢谢