Zulip Chat Archive

Stream: general

Topic: deriving `has_le`


Sky Wilshaw (Nov 04 2022 at 20:41):

Is there an attribute I can use to automatically derive has_le (or other related order typeclasses) on a structure or inductive?

Kevin Buzzard (Nov 04 2022 at 21:03):

You could try @[derive has_le], this definitely works for some data-carrying typeclasses like fintype but I'm not sure it would work for this, because how is Lean supposed to guess the definition you want?

Sky Wilshaw (Nov 04 2022 at 21:08):

Ah that makes sense, thanks. For context, I'm familiar with systems in other languages that just use lexicographic order in the fields of a structure.


Last updated: Dec 20 2023 at 11:08 UTC