coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gregory Malecha <gmalecha AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Record with notation
- Date: Tue, 17 May 2016 09:13:20 -0700
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-oi0-f46.google.com
- Ironport-phdr: 9a23:g0tIxhXydy1nTKLJ4dWm69dYyK7V8LGtZVwlr6E/grcLSJyIuqrYZhOHt8tkgFKBZ4jH8fUM07OQ6PCxHzZQqsfc+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8yVOVUD1Wf1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S43VXxeuR5VCUCR5xbjG5z1ryHSt+xn2SDcM9egHp4uXjH3wL1mRxjymW8iPjo0+2Hewph/iatfrRmhrjRwxofVZMeeM/8oLfCVRs8TWWcUBpUZbCdGGI7pKtJXV+c=
Glad to hear that it works. While there is a lot of boiler-plate, I don't think that it is too complex. The way that Haskell solves the complexity issue (e.g. with Lens's) is to generate definitions automatically. Something like that is probably what we want to do to make it easier to use.
On Tue, May 17, 2016 at 4:11 AM, Pierre Néron <pierre.neron AT polytechnique.org> wrote:
Thanks, it worked out of the box. Something simpler would indeed be nice but at least it does the job.
Pierre NeronOn 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:
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
gregory malecha
- [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.