Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Beginner typeclass question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Beginner typeclass question


Chronological Thread 
  • From: Kevin Sullivan <sullivan.kevinj AT gmail.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: [Coq-Club] Beginner typeclass question
  • Date: Tue, 26 Aug 2014 13:08:16 -0400

I'm trying to use typeclass inheritance (using :>) to model a specialization hierarchy in which subclasses provide values for certain fields that are declared but left abstract in a superclass. This seems not possible. Can someone (a) confirm, and (b) suggest an alternative design pattern. 

The problem: it appears that a super-typeclass has to be fully instantiated before one can instantiate a subclass, but values defined in a subclass are unavailable until the subclass is instantiated -- catch 22. 

In a little more detail, I want to provide an implementation, in a subclass, of a function that is declared but not defined in a type superclass. The implementation is defined in terms of other functions introduced in the subclass.

Kevin



Archive powered by MHonArc 2.6.18.

Top of Page