`Any-∃` 练习的有效类型签名是什么?
What is a valid type signature for the `Any-∃` exercise?
#### Exercise `Any-∃`
Show that `Any P xs` is isomorphic to `∃[ x ∈ xs ] P x`.
撇开 ∃[ x ∈ xs ] P x
甚至不是 的事实 - 只有 Σ[ x ∈ xs ] P x
可能有效,none 我已经尝试过类型签名的类型检查具体问题。
Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → Any P xs ≃ Σ[ x ∈ xs ] P x
List A !=< Set _a_1582 of type Set
when checking that the expression xs has type Set _a_1582
这里最明显的事情失败了。我有点理解这里想问我的问题,但我不确定结构 ∃[ x ∈ xs ] P x
应该是什么。
这是 PLFA 书中 Lists chapter 中的倒数第二个练习。
本书现已更正:
Exercise Any-∃
(练习)
证明 Any P xs
同构于 ∃[ x ] (x ∈ xs × P x)
。
#### Exercise `Any-∃`
Show that `Any P xs` is isomorphic to `∃[ x ∈ xs ] P x`.
撇开 ∃[ x ∈ xs ] P x
甚至不是 Σ[ x ∈ xs ] P x
可能有效,none 我已经尝试过类型签名的类型检查具体问题。
Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → Any P xs ≃ Σ[ x ∈ xs ] P x
List A !=< Set _a_1582 of type Set
when checking that the expression xs has type Set _a_1582
这里最明显的事情失败了。我有点理解这里想问我的问题,但我不确定结构 ∃[ x ∈ xs ] P x
应该是什么。
这是 PLFA 书中 Lists chapter 中的倒数第二个练习。
本书现已更正:
ExerciseAny-∃
(练习)
证明 Any P xs
同构于 ∃[ x ] (x ∈ xs × P x)
。