我有一个记录类型,例如:
Record matrixInt : Type := mkMatrixInt {
const : vector nat dim;
args : vector (matrix dim dim) argCnt
}.
我有一个模式匹配,它返回的类型matrixInt
,我称之为p
例如:(其中function_name p
将返回一个类型matrixInt
。我想p
分成 2 个字段:const
和args
,例如我想要的草稿代码:
Definition my_function cons arg p :=
match function_name p with
| const => const + cons
| args => args + arg
end.
您能否帮我编写p
返回 2 个字段的模式匹配const; args
?非常感谢!