Zulip Chat Archive

Stream: mathlib4

Topic: align for `Repr.reprPrec`


Yakov Pechersky (Nov 07 2022 at 04:12):

How does one align for a structure field? We have #align has_repr Repr, so can we also do #align has_repr.repr Repr.reprPrec?
Without it, the Repr mathlib3port was ported as:

@[to_additive]
instance [Repr α] : Repr αˣ :=
  repr  val

when it should have been:

@[to_additive]
instance [Repr α] : Repr αˣ :=
  reprPrec  val

Mario Carneiro (Nov 07 2022 at 04:14):

has_repr.repr is a pretty bad match for Repr.reprPrec. It is much closer to Repr.repr

Mario Carneiro (Nov 07 2022 at 04:15):

Repr is meta code so it is expected not to align very well. You should expect to have to make modifications to make it work


Last updated: Dec 20 2023 at 11:08 UTC