Many proof assistants have a way to make certain arguments of a function as "implicit", so that the user doesn't have to supply them but they will be solved by unification. Sometimes, such as in Coq, this information is attached to the name of a function rather than its type, and can even be changed by a command such as Arguments
after a function is defined. Other times, as in Agda, there is a first-class notion of "function type whose argument is implicit", distinct from an ordinary function type (but isomorphic to it).
I am interested in reasons why one might make the second choice. My intuition is currently more in line with the first choice: whether a certain argument is implicit seems like a property of the elaborator, rather than an intrinsic aspect of the function that would be described by its type. (In particular, denotational/categorical semantics certainly has no separate notion of "implicit function".) In a sense, declaring f
to have one implicit argument is really just declaring f
to be a notation for what would otherwise be written f _
. And I can also imagine wanting to change the implicitness of certain arguments after a function is defined, which is (as far as I know) impossible with first-class implicit function types. Plus, it seems that the first choice must be easier to implement.
Obviously an advantage of first-class implicit function types is that you can hypothesize implicit functions, take them as arguments to another function, and pass them around as data. But I don't know of any real applications where this is advantageous. Can anyone point to some real code where it is valuable to have first-class implicit function types?
(Note that Coq does allow the fields of a record to be functions with implicit arguments. If the only record types available were generic $\Sigma$-types, then first-class implicit functions would be the only way to bundle implicit functions up with other data, which would certainly be essential. But in the presence of general record types whose fields can be implicit functions, it's harder for me to come up with examples.)
syntax
as you said. $\endgroup$f {a:A} (b:B) {c:C} (d:D)
withsyntax
? $\endgroup$