lean4-htt/tests/lean/run/dep_coe_to_fn.lean
Leonardo de Moura d7c3fce8a3 feat(library/init/coe,frontends/lean): more general coercions to fun
The new test dep_coe_to_fn.lean motivates the change.
2016-09-27 15:41:06 -07:00

11 lines
252 B
Text

universe variables u v
structure Func :=
(A : Type u) (B : Type v) (fn : A → B → A)
instance F_to_fn : has_coe_to_fun Func :=
{ F := λ f, f^.A → f^.B → f^.A,
coe := λ f, f^.fn }
variables (f : Func) (a : f^.A) (b : f^.B)
check (f a b)