Zulip Chat Archive

Stream: new members

Topic: Deriving Repr for an inductive with proof parameters


Graham Leach-Krouse (Apr 18 2024 at 16:23):

Here's something a bit confusing:

inductive test1 : Type where
  | wrap : 2 < 3  test1
  deriving Repr

structure test2 : Type where
  wrap : 2 < 3
  deriving Repr

a Repr instance is derivable for test2, but not test1. Is there an idiomatic way to rewrite test1, keeping it as an inductive type (in the real-world case there might be other constructors), but making Repr derivable? Ideally it would be nice to do this without adding an auxiliary structure like test2 just for wrapping purposes.

Kyle Miller (Apr 18 2024 at 17:48):

Thanks for the report. lean4#3944 has a fix


Last updated: May 02 2025 at 03:31 UTC