Agda使用以下运算符显示集合之间的逆:
_↔_ : ∀ {f t} → Set f → Set t → Set _
在 Idris 中有相应的功能吗?我正在尝试在列表上定义包相等性。
data Elem : a -> List a -> Type where
Here : {xs : List a} -> Elem x (x :: xs)
There : {xs : List a} -> Elem x xs -> Elem x (y :: xs)
(~~) : List a -> List a -> Type
xs ~~ ys {a} = Elem a xs <-> Elem a ys
当l1
和l2
的元素顺序相同时,我们可以构建l1 ~~ l2
。
Agda中↔
的定义似乎非常复杂,我不确定Idris标准库中是否有等效的内容。