lean4-htt/tests/lean/coe4.lean
Sebastian Ullrich fd2c42a8bf chore(library, tests): switch to new attribute declaration syntax
sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean
sed -Ei 's/\s+$//' library/**/*.lean  # remove trailing whitespace
2016-08-12 15:36:12 -07:00

22 lines
394 B
Text

structure Functor (A : Type) :=
(fn : A → A → A) (inj : ∀ x y, fn x = fn y → x = y)
attribute [instance]
definition coe_functor_to_fn (A : Type) : has_coe_to_fun (Functor A) :=
has_coe_to_fun.mk (A → A → A) Functor.fn
constant f : Functor nat
check f 0 1
set_option pp.coercions false
check f 0 1
set_option pp.coercions true
check f 0 1
set_option pp.all true
check f 0 1