Zulip Chat Archive

Stream: new members

Topic: empty {} in inductive type definition


Juan Pablo Romero (Mar 07 2021 at 20:33):

Hi, I'm trying to understand why the empty brackets are useful in definitions like this:

inductive list (α : Type*)
| nil {} : list
| cons : α  list  list

With or without it Leans reports the type of @list.nil as : Π {α : Type}, list α.

Mario Carneiro (Mar 07 2021 at 20:42):

It's vestigial; the default was changed to {}, and the old default is now accessible with []

Kevin Buzzard (Mar 07 2021 at 20:42):

That is correct -- they're not useful. Older literature might have them -- there was a refactor.


Last updated: Dec 20 2023 at 11:08 UTC