lean4-htt/tests/lean/coe3.lean
Leonardo de Moura 49a0d13c50 feat(library/init/coe): add coercion from A to (option A)
A little hack is used to make sure type class resolution will not enter
in an infinite loop.
2017-01-31 17:45:41 -08:00

16 lines
320 B
Text

constants A B₁ B₂ C D : Type
constant A_to_B₁ : has_coe A B₁
constant A_to_B₂ : has_coe A B₂
constant B₁_to_C : has_coe B₁ C
constant B₂_to_D : has_coe B₂ D
attribute [instance] A_to_B₁ A_to_B₂ B₁_to_C B₂_to_D
constant a : A
constant f : C → C
constant g : D → D
check f a
check g a