Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] mathematical function notation

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] mathematical function notation


Chronological Thread 
  • From: Michael Shulman <shulman AT sandiego.edu>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] mathematical function notation
  • Date: Mon, 9 Nov 2015 01:03:05 -0800
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=viritrilbia AT gmail.com; spf=Pass smtp.mailfrom=viritrilbia AT gmail.com; spf=None smtp.helo=postmaster AT mail-lf0-f48.google.com
  • Ironport-phdr: 9a23:H+mBFxNgev90me/qnjcl6mtUPXoX/o7sNwtQ0KIMzox0KPr6rarrMEGX3/hxlliBBdydsKIZzbaM+P28EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35nxi7r5psGbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBO/xeL19RrhFBhwnNXo07Yvlr1OLGQCI/z4XVngcuhtOGQnMqh/gCMTfqCz/48980ymTMMm+drApXTGr6e8/Ux/1jCIOMRYi+Wfbi8F/i+RWrA/39E83+JLdfIzAbKk2RajaZ95PHWc=

On Thu, Nov 5, 2015 at 9:46 AM, Michael Shulman
<shulman AT sandiego.edu>
wrote:
>> I think you can hack with Unicode: the following seems to work for me,
>> where "␣" stands for a zero-width space (U+200B).
>>
>> Notation "f ␣( x )" := (f x)
>> (at level 1, left associativity, format "f ␣( x )").
>
> Cute! This does work, except that it still causes implicit arguments
> to be displayed:
>
> Definition idfunc {T:Type} (x:T) : T := x.
> Check (fun (T:Type) (x:T) => idfunc x = x).
> (* fun (T : Type) (x : T) => idfunc(T) x = x *)

Here's something that seems to work if I'm willing to box up the
functions that I want this notation to apply to (which is no problem):

Record func (A B : Type) := infunc { unfunc :> A -> B }.
Add Printing Coercion unfunc.
Notation "f ␣( x )" := (@unfunc _ _ f x)
(at level 1, left associativity, format "f ␣( x )").

(Thanks, Hugo, in the other thread, for giving me the correct syntax
for "Add Printing Coercion"!)

Mike



Archive powered by MHonArc 2.6.18.

Top of Page