Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Backticks and universally quantified typeclass instances

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Backticks and universally quantified typeclass instances


Chronological Thread 
  • From: Dan Frumin <dfrumin AT cs.ru.nl>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Backticks and universally quantified typeclass instances
  • Date: Thu, 10 Nov 2016 15:53:14 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=dfrumin AT cs.ru.nl; spf=None smtp.mailfrom=dan AT ip-145-116-190-54.wlan-int.ru.nl; spf=None smtp.helo=postmaster AT ip-145-116-190-54.wlan-int.ru.nl
  • Ironport-phdr: 9a23:C3Lqhhc8xMbhVEMswLraxau7lGMj4u6mDksu8pMizoh2WeGdxcuzZB7h7PlgxGXEQZ/co6odzbGH6Oa4Aidesd6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCzbL52Ihi6txndu8cZjYZjKas61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSXZEUstXSidPAJ6zb5EXAuQPPehWsZTzqVgBohSiGAajCvjiyiNUinPqwaE2z/4sHR/A0Qc9H9wOqnPUrNDtOakcS++1yrTDwzXZb/NL3Df96Y7IeQ0mrP6RU7Jwa9fRyUwuFwPDlViftZflMymP1uQQqWSb6e5gWPuphmU6qA9xuiCiytojh4TJnI4Z103I+CRjzIooIdC0VFR3bN6rHZZWqiqULZF5Qtk4TGFtoCs6yqMJuZq8fCUSyZQn3wfTZ+GIfoWI+x7vSfudLDZhiH54fL+zmw++/Eivx+HmWMi01ExFrixcntnNsHANywbf6tKaSvdn+Eeh3S6D1wHV6u5aPUA5jbfXJpEhz7Iqi5YfrEXOEjXrlEjykKOabEUp9+ew5+TieLrmp5ucN4FuigH5N6QjgtGwDv4+MgUVXmib4f2w2KDs8ED5WblGk+A6n6jAvJzHIckXure1Dg9a34o55Re/Cy2p0NIBkXkGKlJFZAiLj5L0O13UJvD4Ce+zg06wnzdz2/DGIrrhD43RIXjEibftZKpy60pByAUo1t1f/JJVCrQZIP3pQEPxtdrYDgU4MwOu2ernBs99hcsiXjekBbbRG6fPuxfc7eU2ZuKIeYU9uTDnKvFj6eS43lEjnlpIUaCvlbUNdXW5GLwyL0uDfH/thP8KCiEQo0w4SLq52xW5TTdPaiPqDOoH7TYhBdfjVN+bSw==

Dear *,

I ran into the following problem recently. Suppose I have typeclasses
(tcA T) and (tcB T) for (T : Type), whereby the second typeclass
depends on the first one.

Class tcA (T: Type).
Class tcB (T: Type) `{tcA T}.


If I have a [Parameter]/[Variable]
(A : Type) then I can write

Context `{tcB A}.

and the backtick magic will register both instances for [tcB A] and
[tcA A]. However, if I have a type family T, and I want to assert [tcB
(T A)] for all types A, I run into a problem.

Variable T : Type -> Type.
Context `{forall A, (tcB (T A))}.

Error: Cannot infer the implicit parameter H of tcB whose type is "tcA (T A)" (no type class instance found) in environment:
A : Type

It makes sense that it doesn't work, but does anyone know of a
workaround for this?

Kind regards,
- Dan



Archive powered by MHonArc 2.6.18.

Top of Page