【发布时间】:2020-01-03 17:18:33
【问题描述】:
我在 Idris 中将幺半群定义为
interface Is_monoid (ty : Type) (op : ty -> ty -> ty) where
id_elem : () -> ty
proof_of_left_id : (a : ty) -> ((op a (id_elem ())) = a)
proof_of_right_id : (a : ty) -> ((op (id_elem ())a) = a)
proof_of_associativity : (a, b, c : ty) -> ((op a (op b c)) = (op (op a b) c))
然后尝试将组定义为
interface (Is_monoid ty op) => Is_group (ty : Type) (op : ty -> ty -> ty) where
inverse : ty -> ty
proof_of_left_inverse : (a : ty) -> (a = (id_elem ()))
但在编译过程中显示
When checking type of Group.proof_of_left_inverse:
Can't find implementation for Is_monoid ty op
有没有办法解决。
【问题讨论】:
标签: idris