0
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?

Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21

1 Answers1

2

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.

gallais
  • 11,823
  • 2
  • 30
  • 63
  • Yeah, I missed a symbol here. This answers the question that I asked, but not quite the one [I wanted](https://stackoverflow.com/questions/56375003/what-is-a-valid-type-signature-for-the-any-%E2%88%83-exercise). – Marko Grdinić May 30 '19 at 09:06