Zulip Chat Archive

Stream: lean4

Topic: export structure field shorthand


Horațiu Cheval (Aug 01 2022 at 20:01):

Is there a way to export a structure field right away when defining the structure?
Something like

class Box (α : Type) where
  export box : α  α

as a shorthand for

class Box (α : Type) where
  box : α  α
export Box (box)

Henrik Böving (Aug 01 2022 at 20:03):

If there is I haven't seen it so far so most likely no, the compiler also uses the 2nd notation all over the place.

Mac (Aug 02 2022 at 02:41):

I suggest this feature a while back in Field Exports [RFC]. The consensus seemed to be that while it is convenient sugar, it is not worth the cycles to implement.


Last updated: Dec 20 2023 at 11:08 UTC