lean4-htt/tests/lean/field_access.lean
2017-03-09 18:41:19 -08:00

25 lines
536 B
Text

#check list.map
variable l : list nat
#check l~>1 -- Error l is not a structure
#check (1, 2)~>5 -- Error insufficient fields
example (l : list nat) : list nat :=
l~>forr (λ x, x + 1) -- Error there is no list.forr
example (A : Type) (a : A) : A :=
a~>symm -- Error type of 'a' is not a constant application
example (l : list nat) : list nat :=
l~>for (λ x, x + 1)
example (l : list nat) : list nat :=
l^.for (λ x, x + 1)
example (a b : nat) (h : a = b) : b = a :=
h~>symm
example (a b : nat) (h : a = b) : b = a :=
h^.symm