Zulip Chat Archive

Stream: lean4

Topic: get default value


Joseph O (Feb 17 2022 at 15:04):

How can i get the default values of a type?

Mario Carneiro (Feb 17 2022 at 15:06):

The default function returns it, or you can peek at that type's Inhabited instance declaration

Joseph O (Feb 17 2022 at 15:35):

Then why does doing

#eval default Nat

give the error

function expected at
  default
term has type
  ?m.18

Yakov Pechersky (Feb 17 2022 at 15:38):

#eval (default : Nat)

Yakov Pechersky (Feb 17 2022 at 15:38):

default doesn't take the type as an explicit arg

Joseph O (Feb 17 2022 at 15:53):

ah


Last updated: Dec 20 2023 at 11:08 UTC