lean4-htt/tests/lean/run/509.lean
Leonardo de Moura a435f3d641 feat: reduce s.1 =?= v to s =?= ⟨v⟩ if structure has a single field
This feature was suggested by @dselsam at PR #521.
It closes #509
2021-06-11 11:23:19 -07:00

34 lines
911 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.

class has_note (M : Type) where
note : M
notation "♩" => has_note.note
class has_note2 (M : Type) extends has_note M
variable {ι : Type} (β : ι → Type)
structure foo [∀ i, has_note (β i)] : Type where
to_fun : ∀ i, β i
instance foo.has_note [∀ i, has_note (β i)] : has_note (foo (λ i => β i)) where
note := { to_fun := λ _ => ♩ }
instance foo.has_note2 [∀ i, has_note2 (β i)] : has_note2 (foo (λ i => β i)) where
note := ♩
variable (α : Type) (M : Type)
structure bar [has_note M] where
to_fun : α → M
instance bar.has_note [has_note M] : has_note (bar α M) where
note := { to_fun := λ _ => ♩ }
instance bar.has_note2 [has_note2 M] : has_note2 (bar α M) where
note := ♩
example [has_note2 M] : has_note2 (foo (λ (i : ι) => bar (β i) M)) :=
inferInstance
example [has_note2 M] : has_note2 (foo (λ (i : ι) => bar (β i) M)) :=
foo.has_note2 _