coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Typeclasses vs canonical instances
- Date: Mon, 13 Jun 2016 07:32:17 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga01.intel.com
- Ironport-phdr: 9a23:whJdGh8JajCakP9uRHKM819IXTAuvvDOBiVQ1KB91OkcTK2v8tzYMVDF4r011RmSDdSdu6oP0bqN+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt+U35z8jbDps7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JsKWqLjOq88ULZwDTI8Mmlz6teh/U3IShLK7X8BWE0XlABJCk7L9kepcI32t36wje1w1zWAOtWyBZU1UjSr4qMhAEvtiSwHPjM9tnrQh8NslqVDiBOnuxF7hYXTZdfGZ7JFYqrBcIZCFiJ6VcFLWnkZDw==
Dear Vadim,
I need to decide for a larger library development if I am going to use type classes or canonical instances. I would like to learn how bad instance resolution can get. I have quite some experience with getting normal eauto (not for instance but for goal resolution) behave well. If you could share an example, I might be able to help you getting it more well behaved and at the same time learn about the issues one might have.
Best regards,
Michael
From: vadim.zaliva AT west.cmu.edu [mailto:vadim.zaliva AT west.cmu.edu]
On Behalf Of Vadim Zaliva
On Mon, Apr 25, 2016 at 2:41 PM, Gregory Malecha <gmalecha AT gmail.com> wrote: 1/ They do not have as predictable of a resolution mechanism (it is essentially [eauto with typeclass_instances]), and it is invoked later. My understanding is that (morally) the entire term is constructed with holes and then type class resolution tries to solve each hole that exists and has a type that is declared as a class (either using 'Class xxx := ...' or 'Existing Class xxx.'). In addition typeclass resolution has a tendency to loop infinitely when things go wrong which can be very annoying.
1. Analysing type class resolution debug logs is not easy. I wish somebody explain clearly how resolution works, and what different log messages means (backtracking, exact, etc.) I have some intuitions but I feel that there are certain patterns like, loops, or branches where search get stuck could be derived from logs with simple scripting.
2. I want better control of type class resolution. Oftentimes, looking at the _expression_ I can sketch sequence of steps which will get all type class dependencies resolved. Unfortunately I could not control if resolver goes other way. It is painful to see it trying search in wrong direction. The only mechanism to control this I know about is class instance priorities, but they are static and I could not re-assign them. Some kind of hint mechanism for type class resolution would be great.
It would be great to hear some tips and tricks from people who spent more time dealing with problems like. -- CMU ECE PhD candidate Mobile: +1(510)220-1060
Intel Deutschland GmbH |
- Re: [Coq-Club] Typeclasses vs canonical instances, Vadim Zaliva, 06/11/2016
- RE: [Coq-Club] Typeclasses vs canonical instances, Soegtrop, Michael, 06/13/2016
Archive powered by MHonArc 2.6.18.