lean4-htt/tests/elabissues/Reid1.lean
2019-10-19 13:26:47 -07:00

24 lines
600 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

structure constantFunction (α β : Type) :=
(f : α → β)
(h : ∀ a₁ a₂, f a₁ = f a₂)
instance {α β : Type} : HasCoeToFun (constantFunction α β) :=
⟨_, constantFunction.f⟩
def myFun {α : Type} : constantFunction α (Option α) :=
{ f := fun a => none,
h := fun a₁ a₂ => rfl }
def myFun' (α : Type) : constantFunction α (Option α) :=
{ f := fun a => none,
h := fun a₁ a₂ => rfl }
#check myFun 3
#check @myFun Nat 3 -- works
#check myFun' _ 3
#check myFun' Nat 3 -- works
#check ⇑myFun 3
#check ⇑(myFun' _) 3
#check ⇑(myFun' Nat) 3