lean4-htt/tests/lean/run/coeIssue3.lean
2020-10-25 09:16:38 -07:00

23 lines
500 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 Var : Type := (name : String)
instance Var.nameCoe : Coe String Var := ⟨Var.mk⟩
structure A : Type := (u : Unit)
structure B : Type := (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 => coe a⟩
open Foo
open Bar
#check Foo.chalk a ["foo"] -- works
#check chalk a ["foo"] -- works