coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jonathan Leivent <jonikelee AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Backticks and universally quantified typeclass instances
- Date: Thu, 10 Nov 2016 10:26:02 -0500
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f170.google.com
- Ironport-phdr: 9a23:SVIrhxWKBqnmct8cvDbhTzgMMxHV8LGtZVwlr6E/grcLSJyIuqrYYxCOt8tkgFKBZ4jH8fUM07OQ6PG7HzRbqsnd+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe71/IRG4oAnLqsUbj4RuJ6Q+xxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuA+vqQJxw4DUY4+bOvRxcazfctwGSmRMRdpRWi5bD4+gc4cCAeoMMOBFpIf9vVsOqh6+CBGoCuPozD9HnGP23a0g3OQnDArI2hIvH9MQsHvKqtX1KLoZXOe3zKnPyzXDbvBW1in56IfWbB8suv6MXbdqfsrQzUkjDR/KjlKVqYH8OT6ey+cDs3CD4uZ+Se6ij3QrpgJxrzS12MsglJXFipgIxl3G6Sl12IQ4KcCiREJlb9OpH4FcuzyUOodqWM8uXW9ltSQ8x7Ybo5C0ZjIKx44ixxPHa/yIbYyI4hX7WeaUOzh4hXZldKumhxax7USs0+P8WtS23VpWtCZFnd7MtncC1xzX9MeLUOdy/kCk2TqX1gDT7P9LIVwsmKbFN5IsxqQ8m5kTvEjZACP6hln6gLWLekgm5uSk8+Hnba/npp+YOY90kAb+MqE2l8y9BuQ4NAkOX2uF9uS4yrLs41b0QLpPjvIsk6nZtIrWKtgcpq68GwNVyJos6w6jDze619QVhWUILFVceB6ek4fpP0zOL+vjAPekg1WslS9ryOrcMr3gBJXNNHnDn637cbZz8U4PgDY0mNtY/tdfDqwLCPP1QE748tLCXTEjNAnh4eHhAcl934VWfW+OHKKfLOuGs1iO5+EiJ+SBTIAQsTf5bfMi4qi93jcChVYBcPzxjtMsY3eiE6E+Lg==
Is this what you want?:
Class tcA (T: Type).
Class tcB (T: Type) `{tcA T}.
Variable T : Type -> Type.
Context `{forall A, tcA (T A)}.
Context `{forall A, (tcB (T A))}.
or this?:
Class tcA (T: Type).
Class tcB (T: Type) `{tcA T}.
Variable T : Type -> Type.
Context `{forall A, {b:tcA (T A) & (@tcB (T A) b)}}.
-- Jonathan
On 11/10/2016 09:53 AM, Dan Frumin wrote:
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
- [Coq-Club] Backticks and universally quantified typeclass instances, Dan Frumin, 11/10/2016
- Re: [Coq-Club] Backticks and universally quantified typeclass instances, Jonathan Leivent, 11/10/2016
- Re: [Coq-Club] Backticks and universally quantified typeclass instances, Dan Frumin, 11/10/2016
- Re: [Coq-Club] Backticks and universally quantified typeclass instances, Jonathan Leivent, 11/10/2016
- Re: [Coq-Club] Backticks and universally quantified typeclass instances, Dan Frumin, 11/10/2016
- Re: [Coq-Club] Backticks and universally quantified typeclass instances, Jonathan Leivent, 11/10/2016
Archive powered by MHonArc 2.6.18.