What does \ forall (∀) mean in a signature?

From the bits and pieces of information that I gathered about agda, I (apparently mistakenly) came to the conclusion that it is ∀ {A}equivalent {A : Set}. Now I noticed that

flip : ∀ {A B C} -> (A -> B -> C) -> (B -> A -> C)

invalid (something about Set \ omega, which in turn seems to be something internal, but

flip : {A B C : Set} -> (A -> B -> C) -> (B -> A -> C)

in order. Can anyone clarify this for me?

+4
source share
1 answer

This is because it ∀ {A}is actually just syntactic sugar for {A : _}, which asks the compiler to automatically fill A.

This does not work very well with Sets only , because you could:

{A : Set}
{A : Set₁}
{A : Set₂}
-- etc.

, . , .

, :

data List (A : Set) : Set where
  -- ...

map : ∀ {A B} → (A → B) → List A → List B
map = -- ...

A Set, List Set s.

, {A : _}, , , Set s.

_+_ : ℕ → ℕ → ℕ
_+_ = -- ...

comm : ∀ x y → x + y ≡ y + x
comm = -- ...

, , :

map : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → List A → List B

A b Level; .

+6

All Articles