coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Néron <pierre.neron AT polytechnique.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Record with notation
- Date: Tue, 17 May 2016 13:11:39 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pierre.neron AT gmail.com; spf=Pass smtp.mailfrom=pierre.neron AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f42.google.com
- Ironport-phdr: 9a23:biT2mR+DkhtXJ/9uRHKM819IXTAuvvDOBiVQ1KB91+wcTK2v8tzYMVDF4r011RmSDdSdsaIP0LaempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lS8iI34/si6ibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MlZFK7+Yq4QTLpCDT1gPXpmytfssEz7TAaV/HYrdOQMlRwAVxDE4QvgU9H3vzH9sMJl3y2LIcD9TbY1QCmvqaBxR0m72288Kzcl/TSP2YRLh6VBrUf5qg==
Thanks, it worked out of the box. Something simpler would indeed be
nice but at least it does the job.Pierre Neron On 05/13/2016 06:57 PM, Gregory Malecha
wrote:
Hello, Pierre --
I hacked something like this together a while ago. The
latest incarnation is probably not quite up to snuff but the
ideas can be found in this file:
https://github.com/coq-ext-lib/coq-ext-lib/blob/v8.5/theories/Programming/With.v
Note: To use this code you need to declare some type class
instances (namely Struct and Accessor) for records that you
would like to do this for.
I'd be happy to chat more with you about it and fix up the
code to make it easier to use. One thing that I think is
important about this implementation is that 'with' desugars
definitionally/judgementally rather than just propositionally
which is very important for computation.
On Fri, May 13, 2016 at 2:54 AM, Pierre
Néron <pierre.neron AT polytechnique.org>
wrote:
Is there a way to define in Coq a notation similar to OCaml "with" notation for records ? { rec with foo := bar} would be a record with the same fields as "rec" except for field "foo" which would have value bar. I did not manage to define one even for a specific record type. Thanks in advance -- Pierre Neron gregory malecha
gmalecha.github.io
|
- [Coq-Club] Record with notation, Pierre Néron, 05/13/2016
- Re: [Coq-Club] Record with notation, Gregory Malecha, 05/13/2016
- Re: [Coq-Club] Record with notation, Pierre Néron, 05/17/2016
- Re: [Coq-Club] Record with notation, Gregory Malecha, 05/17/2016
- Re: [Coq-Club] Record with notation, Pierre Néron, 05/17/2016
- Re: [Coq-Club] Record with notation, Gregory Malecha, 05/13/2016
Archive powered by MHonArc 2.6.18.