How to import the `∃-syntax`?

风流意气都作罢 提交于 2019-12-11 15:18:24

问题


open import Data.Product using (_×_; ∃; ∃-syntax)
open import Data.List

Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → ∃[ x ∈ xs ] P x
Could not parse the application ∃[ x ∈ xs ] P x
Operators used in the grammar:
  ∃[_] (prefix notation, level 20) [∃-syntax (C:\Users\Marko\AppData\Roaming\cabal\x86_64-windows-ghc-8.6.5\Agda-2.6.0\lib\agda-stdlib\src\Data\Product.agda:78,1-9)]
when scope checking ∃[ x ∈ xs ] P x

For some reason it seems like it is not importing the precedence properly from the standard library module. Defining it as...

Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → ∃[ x ] P x

...will make it pass parsing, but I am not sure this is doing the right thing for one of the problems I am trying to solve.

What should I do here?


回答1:


is precisely for the cases where you can leave out the domain of the function because it's evident. Otherwise you are supposed to use Σ. And indeed Σ-syntax does give you the ability to write Σ[ x ∈ A ] B.



来源:https://stackoverflow.com/questions/56356229/how-to-import-the-%e2%88%83-syntax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!