blob: 1ac9ccd616e6186b682db903c869a49067bc2d0b [file]
structure Var : Type where (name : String)
instance Var.nameCoe : Coe String Var := ⟨Var.mk⟩
structure A : Type where (u : Unit)
structure B : Type where (u : Unit)
def a : A := A.mk ()
def b : B := B.mk ()
def Foo.chalk : A → List Var → Unit := fun _ _ => ()
def Bar.chalk : B → Unit := fun _ => ()
instance listCoe {α β} [Coe α β] : Coe (List α) (List β) :=
⟨fun as => as.map fun (a : α) => ↑a⟩
open Foo
open Bar
#check Foo.chalk a ["foo"] -- works
#check chalk a ["foo"] -- works