Debian Codegraph @

test-suite/success/universes_coercion.v

raw
1 (* This example used to emphasize the absence of LEGO-style universe
2 polymorphism; Matthieu's improvements of typing on 2011/3/11 now
3 makes (apparently) that Amokrane's automatic eta-expansion in the
4 coercion mechanism works; this makes its illustration as a "weakness"
5 of universe polymorphism obsolete (example submitted by Randy Pollack).
6
7 Note that this example is not an evidence that the current
8 non-kernel eta-expansion behavior is the most expected one.
9 *)
10
11 Parameter K : forall T : Type, T -> T.
12 Check (K (forall T : Type, T -> T) K).
13
14 (*
15 note that the inferred term is
16 "(K (forall T (* u1 *) : Type, T -> T) (fun T:Type (* u1 *) => K T))"
17 which is not eta-equivalent to
18 "(K (forall T : Type, T -> T) K"
19 because the eta-expansion of the latter
20 "(K (forall T : Type, T -> T) (fun T:Type (* u2 *) => K T)"
21 assuming K of type "forall T (* u2 *) : Type, T -> T"
22 *)