Zulip Chat Archive

Stream: general

Topic: make explicit argument implicit


Zesen Qian (Jul 30 2018 at 14:56):

Hi, is it possible to temprorarily make an argument implicit? Say, instead of id bool true, I write something like id _ true and let the elaborator to infer the omitted argument for me. (id : \forall A, A -> A is completely explicit)

Zesen Qian (Jul 30 2018 at 15:10):

funny, seems lean can already do it exactly like I demonstrated. never knew that.

Reid Barton (Jul 30 2018 at 15:10):

You can already write id _ true and the elaborator will infer the argument (though true is a Prop, not a bool).
Did you have something else in mind?

Reid Barton (Jul 30 2018 at 15:10):

Ah, okay.

Reid Barton (Jul 30 2018 at 15:11):

A useful trick with this is also to define a notation local notation `id'` := id _ if you want to make an argument implicit in an entire file/section of code.

Zesen Qian (Jul 30 2018 at 15:12):

@Reid Barton good, thanks.


Last updated: Dec 20 2023 at 11:08 UTC